Class yii\redis\LuaScriptBuilder

Inheritanceyii\redis\LuaScriptBuilder » yii\base\Object
Implementsyii\base\Configurable
Available since version2.0
Source Code https://github.com/yiisoft/yii2-redis/blob/master/LuaScriptBuilder.php

LuaScriptBuilder builds lua scripts used for retrieving data from redis.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Object
__construct() Constructor. yii\base\Object
__get() Returns the value of an object property. yii\base\Object
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Object
__set() Sets value of an object property. yii\base\Object
__unset() Sets an object property to null. yii\base\Object
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
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Object
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Object
className() Returns the fully qualified name of this class. yii\base\Object
hasMethod() Returns a value indicating whether a method is defined. yii\base\Object
hasProperty() Returns a value indicating whether a property is defined. yii\base\Object
init() Initializes the object. yii\base\Object

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
buildCompositeInCondition() 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

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