Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @author Jaap Jansma <jaap.jansma@civicoop.org>
* @license AGPL-3.0
*/
namespace Civi\DataProcessor\DataFlow\SqlDataFlow;
class IsNullWhereClause implements WhereClauseInterface {
protected $table_alias;
protected $field;
protected $operator;
protected $value;
protected $isJoinClause = FALSE;
public function __construct($table_alias, $field, $isJoinClause=FALSE) {
$this->isJoinClause = $isJoinClause;
$this->table_alias = $table_alias;
$this->field = $field;
}
/**
* Returns true when this where clause can be added to the
* join or whether this clause should be propagated to the where part of the query
*
* @return bool
*/
public function isJoinClause() {
return $this->isJoinClause;
}
/**
* Returns the where clause
* E.g. contact_type = 'Individual'
*
* @return string
*/
public function getWhereClause() {
return "`{$this->table_alias}`.`{$this->field}` IS NULL";
}
}