Class yii\redis\LuaScriptBuilder

Inheritanceyii\redis\LuaScriptBuilder » yii\base\BaseObject
Available since version2.0

LuaScriptBuilder builds lua scripts used for retrieving data from redis.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
buildAll() Builds a Lua script for finding a list of records yii\redis\LuaScriptBuilder
buildAverage() Builds a Lua script for finding the average of a column yii\redis\LuaScriptBuilder
buildColumn() Builds a Lua script for finding a column yii\redis\LuaScriptBuilder
buildCondition() Parses the condition specification and generates the corresponding Lua expression. yii\redis\LuaScriptBuilder
buildCount() Builds a Lua script for getting count of records yii\redis\LuaScriptBuilder
buildMax() Builds a Lua script for finding the max value of a column yii\redis\LuaScriptBuilder
buildMin() Builds a Lua script for finding the min value of a column yii\redis\LuaScriptBuilder
buildOne() Builds a Lua script for finding one record yii\redis\LuaScriptBuilder
buildSum() Builds a Lua script for finding the sum of a column yii\redis\LuaScriptBuilder

Method Details

buildAll() public method

Builds a Lua script for finding a list of records

public string buildAll ( $query )
$query yii\redis\ActiveQuery

The query used to build the script

buildAverage() public method

Builds a Lua script for finding the average of a column

public string buildAverage ( $query, $column )
$query yii\redis\ActiveQuery

The query used to build the script

$column string

Name of the column

buildColumn() public method

Builds a Lua script for finding a column

public string buildColumn ( $query, $column )
$query yii\redis\ActiveQuery

The query used to build the script

$column string

Name of the column

buildCompareCondition() protected method

protected void buildCompareCondition ( $operator, $operands, &$columns )
$operator
$operands
$columns
buildCompositeInCondition() protected method

protected void buildCompositeInCondition ( $operator, $inColumns, $values, &$columns )
$operator
$inColumns
$values
$columns
buildCondition() public method

Parses the condition specification and generates the corresponding Lua expression.

public string buildCondition ( $condition, &$columns )
$condition string|array

The condition specification. Please refer to yii\redis\ActiveQuery::where() on how to specify a condition.

$columns array

The list of columns and aliases to be used

return string

The generated SQL expression

throws \yii\db\Exception

if the condition is in bad format

throws \yii\base\NotSupportedException

if the condition is not an array

buildCount() public method

Builds a Lua script for getting count of records

public string buildCount ( $query )
$query yii\redis\ActiveQuery

The query used to build the script

buildMax() public method

Builds a Lua script for finding the max value of a column

public string buildMax ( $query, $column )
$query yii\redis\ActiveQuery

The query used to build the script

$column string

Name of the column

buildMin() public method

Builds a Lua script for finding the min value of a column

public string buildMin ( $query, $column )
$query yii\redis\ActiveQuery

The query used to build the script

$column string

Name of the column

buildOne() public method

Builds a Lua script for finding one record

public string buildOne ( $query )
$query yii\redis\ActiveQuery

The query used to build the script

buildSum() public method

Builds a Lua script for finding the sum of a column

public string buildSum ( $query, $column )
$query yii\redis\ActiveQuery

The query used to build the script

$column string

Name of the column