Class yii\redis\LuaScriptBuilder
Inheritance | yii\redis\LuaScriptBuilder » yii\base\BaseObject |
---|---|
Available since version | 2.0 |
LuaScriptBuilder builds lua scripts used for retrieving data from redis.
Public Methods
Method | Description | Defined 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 |
Protected Methods
Method | Description | Defined By |
---|---|---|
buildCompareCondition() | yii\redis\LuaScriptBuilder | |
buildCompositeInCondition() | yii\redis\LuaScriptBuilder |
Method Details
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 |
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 |
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 |
protected void buildCompareCondition ( $operator, $operands, &$columns ) | ||
$operator | ||
$operands | ||
$columns |
protected void buildCompositeInCondition ( $operator, $inColumns, $values, &$columns ) | ||
$operator | ||
$inColumns | ||
$values | ||
$columns |
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 |
Builds a Lua script for getting count of records
public string buildCount ( $query ) | ||
$query | yii\redis\ActiveQuery | The query used to build the script |
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 |
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 |
Builds a Lua script for finding one record
public string buildOne ( $query ) | ||
$query | yii\redis\ActiveQuery | The query used to build the script |
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 |