# Class yii\redis\LuaScriptBuilder

Inheritance | yii\redis\LuaScriptBuilder » yii\base\BaseObject
Implements | yii\base\Configurable
Available since version | 2.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

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

## Protected Methods

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
buildCompareCondition() |  | yii\redis\LuaScriptBuilder
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

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