PHP Class yii\elasticsearch\QueryBuilder

Since: 2.0
Author: Carsten Brandt ([email protected])
Inheritance: extends yii\base\Object
ファイルを表示 Open project: yiisoft/yii2-elasticsearch Class Usage Examples

Public Properties

Property Type Description
$db the database connection.

Public Methods

Method Description
__construct ( Connection $connection, array $config = [] ) Constructor.
build ( Query $query ) : array Generates query from a Query object.
buildCondition ( string | array $condition ) : string Parses the condition specification and generates the corresponding SQL expression.
buildOrderBy ( $columns ) adds order by condition to the query

Protected Methods

Method Description
buildCompositeInCondition ( $operator, $columns, $values )

Private Methods

Method Description
buildAndCondition ( $operator, $operands )
buildBetweenCondition ( $operator, $operands )
buildHalfBoundedRangeCondition ( string $operator, array $operands ) : array Builds a half-bounded range condition (for "gt", ">", "gte", ">=", "lt", "<", "lte", "<=" operators)
buildHashCondition ( $condition )
buildInCondition ( $operator, $operands )
buildLikeCondition ( $operator, $operands )
buildNotCondition ( $operator, $operands )

Method Details

__construct() public method

Constructor.
public __construct ( Connection $connection, array $config = [] )
$connection Connection the database connection.
$config array name-value pairs that will be used to initialize the object properties

build() public method

Generates query from a Query object.
public build ( Query $query ) : array
$query Query the [[Query]] object from which the query will be generated
return array the generated SQL statement (the first array element) and the corresponding parameters to be bound to the SQL statement (the second array element).

buildCompositeInCondition() protected method

protected buildCompositeInCondition ( $operator, $columns, $values )

buildCondition() public method

Parses the condition specification and generates the corresponding SQL expression.
public buildCondition ( string | array $condition ) : string
$condition string | array the condition specification. Please refer to [[Query::where()]] on how to specify a condition.
return string the generated SQL expression

buildOrderBy() public method

adds order by condition to the query
public buildOrderBy ( $columns )

Property Details

$db public_oe property

the database connection.
public $db