redis\ActiveRecord updateAll()

updateAll() public static method Updates the whole table using the provided attribute values and conditions. For example, to change the status to be 1 for all customers whose status is 2: Customer::updateAll(['status' => 1], ['id' => 2]); public static integer updateAll ( $attributes, $condition = null )$attributes array Attribute values (name-value pairs) to be saved into the table $condition array The conditions that will be put in the WHERE part of the UPDATE SQL. Please refe

redis\ActiveRecord updateAllCounters()

updateAllCounters() public static method Updates the whole table using the provided counter changes and conditions. For example, to increment all customers' age by 1, Customer::updateAllCounters(['age' => 1]); public static integer updateAllCounters ( $counters, $condition = null )$counters array The counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters. $condition array The conditions that will be put in the WHERE

redis\ActiveRecord insert()

insert() public method Inserts the record into the database using the attribute values of this record. Usage example: $customer = new Customer; $customer->name = $name; $customer->email = $email; $customer->insert(); public boolean insert ( $runValidation = true, $attributes = null )$runValidation boolean Whether to perform validation (calling \yii\redis\Model::validate()) before saving the record. Defaults to true. If the validation fails, the record will not be saved to the d

redis\ActiveRecord getDb()

getDb() public static method Returns the database connection used by this AR class. By default, the "redis" application component is used as the database connection. You may override this method if you want to use a different database connection. public static yii\redis\Connection getDb ( )return yii\redis\Connection The database connection used by this AR class.

redis\ActiveRecord keyPrefix()

keyPrefix() public static method Declares prefix of the key that represents the keys that store this records in redis. By default this method returns the class name as the table name by calling yii\helpers\Inflector::camel2id(). For example, 'Customer' becomes 'customer', and 'OrderItem' becomes 'order_item'. You may override this method if you want different key naming. public static string keyPrefix ( )return string The prefix to apply to all AR keys

redis\ActiveRecord primaryKey()

primaryKey() public static method Returns the primary key name(s) for this AR class. This method should be overridden by child classes to define the primary key. Note that an array should be returned even when it is a single primary key. public static string[] primaryKey ( )return string[] The primary keys of this record.

redis\ActiveRecord deleteAll()

deleteAll() public static method Deletes rows in the table using the provided conditions. WARNING: If you do not specify any condition, this method will delete ALL rows in the table. For example, to delete all customers whose status is 3: Customer::deleteAll(['status' => 3]); public static integer deleteAll ( $condition = null )$condition array The conditions that will be put in the WHERE part of the DELETE SQL. Please refer to yii\redis\ActiveQuery::where() on how to specify this pa

redis\ActiveRecord buildKey()

buildKey() public static method Builds a normalized key from a given primary key value. public static string buildKey ( $key )$key mixed The key to be normalized return string The generated key

redis\ActiveRecord find()

find() public static method Creates an \yii\redis\ActiveQueryInterface instance for query purpose. The returned \yii\redis\ActiveQueryInterface instance can be further customized by calling methods defined in \yii\redis\ActiveQueryInterface before one() or all() is called to return populated ActiveRecord instances. For example, // find the customer whose ID is 1 $customer = Customer::find()->where(['id' => 1])->one(); // find all active customers and order them by their age: $cust

redis\ActiveQuery sum()

sum() public method Returns the number of records. public integer sum ( $column, $db = null )$column string The column to sum up $db yii\redis\Connection The database connection used to execute the query. If this parameter is not given, the db application component will be used. return integer Number of records