Skip to main content

GF_Query_Condition

The Gravity Forms Query Condition class.

Source: includes/query/class-gf-query-condition.php:6

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
__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

NameTypeDefaultDescription
$leftGF_Query_Column | GF_Query_Call | GF_Query_Literal | nullnullThe left-hand expression.
$operatorstring | nullnullThe operator.
$rightGF_Query_Column | GF_Query_Call | GF_Query_Literal | GF_Query_Series | nullnullThe right-hand expression.

Returns

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

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

Source: includes/query/class-gf-query-condition.php:186

sql()

public function sql( $query )

Compile the expressions into a SQL string.

Parameters

NameTypeDefaultDescription
$queryGF_QueryThe 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

NameTypeDefaultDescription
$expressionmixedThe 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

NameTypeDefaultDescription
$key

Source: includes/query/class-gf-query-condition.php:537