Completed
Push — develop ( 18a26b...e6f109 )
by Gennady
16:45
created

GF_Query_Condition_IS_NULL::sql()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace GV\Mocks;
3
4
/**
5
 * Gravity Forms GF_Query does not support NULL condition clauses.
6
 *
7
 * Implement them as needed.
8
 */
9
class GF_Query_Condition_IS_NULL extends \GF_Query_Condition {
10
	private $override_placeholder = '{GF_Query_Condition_IS_NULL_override}';
11
12
	public function __construct( $left = null, $operator = null, $right = null ) {
13
		parent::__construct( $left, self::EQ, new \GF_Query_Literal( $this->override_placeholder ) );
14
	}
15
16
	public function sql( $query ) {
17
		return str_replace( "= '{$this->override_placeholder}'", 'IS NULL', parent::sql( $query ) );
18
	}
19
}
20