GF_Query_Condition
The Gravity Forms Query Condition class.
Source: includes/query/class-gf-query-condition.php:6
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
__construct() | A condition. |
_and() | Tie several conditions together with an AND relationship. |
_or() | Tie several conditions together with an OR relationship. |
sql() | Compile the expressions into a SQL string. |
is_valid_expression_type() | Checks whether the expression is of a valid type. |
get_columns() | Retrieve all the columns present in the left, right clauses. |
__get() | Proxy read-only values. |
Method Reference
__construct()
public function __construct( $left=null, $operator=null, $right=null )
A condition.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$left | GF_Query_Column | GF_Query_Call | GF_Query_Literal | null | null | The left-hand expression. |
$operator | string | null | null | The operator. |
$right | GF_Query_Column | GF_Query_Call | GF_Query_Literal | GF_Query_Series | null | null | The right-hand expression. |
Returns
- GF_Query_Condition — $this This condition.
Source: includes/query/class-gf-query-condition.php:131
_and()
public static function _and()
Tie several conditions together with an AND relationship.
Accepts any number of GF_Query_Condition objects.
Returns
- GF_Query_Condition — The condition.
Source: includes/query/class-gf-query-condition.php:164
_or()
public static function _or()
Tie several conditions together with an OR relationship.
Accepts any number of GF_Query_Condition objects.
Returns
- GF_Query_Condition — The condition.
Source: includes/query/class-gf-query-condition.php:186
sql()
public function sql( $query )
Compile the expressions into a SQL string.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$query | GF_Query | The query. |
Returns
string— The SQL string.
Source: includes/query/class-gf-query-condition.php:209
is_valid_expression_type()
public static function is_valid_expression_type( $expression )
Checks whether the expression is of a valid type.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$expression | mixed | The expression to check. |
Returns
boolean— Valid or not.
Source: includes/query/class-gf-query-condition.php:391
get_columns()
public function get_columns()
Retrieve all the columns present in the left, right clauses.
Returns
array— The columns.
Source: includes/query/class-gf-query-condition.php:488
__get()
public function __get( $key )
Proxy read-only values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
Source: includes/query/class-gf-query-condition.php:537