db\ActiveRecordInterface getAttribute()

getAttribute() public abstract method Returns the named attribute value. If this record is the result of a query and the attribute is not loaded, null will be returned. See also hasAttribute(). public abstract mixed getAttribute ( $name )$name string The attribute name return mixed The attribute value. null if the attribute is not set or does not exist.

db\ActiveRecordInterface findOne()

findOne() public abstract static method Returns a single active record model instance by a primary key or an array of column values. The method accepts: a scalar value (integer or string): query by a single primary key value and return the corresponding record (or null if not found). a non-associative array: query by a list of primary key values and return the first record (or null if not found). an associative array of name-value pairs: query by a set of attribute values and return a singl

db\ActiveRecordInterface findAll()

findAll() public abstract static method Returns a list of active record models that match the specified primary key value(s) or a set of column values. The method accepts: a scalar value (integer or string): query by a single primary key value and return an array containing the corresponding record (or an empty array if not found). a non-associative array: query by a list of primary key values and return the corresponding records (or an empty array if none was found). Note that an empty con

db\ActiveRecordInterface find()

find() public abstract static method Creates an yii\db\ActiveQueryInterface instance for query purpose. The returned yii\db\ActiveQueryInterface instance can be further customized by calling methods defined in yii\db\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: $custome

db\ActiveRecordInterface equals()

equals() public abstract method Returns a value indicating whether the given active record is the same as the current one. Two new records are considered to be not equal. public abstract boolean equals ( $record )$record static Record to compare to return boolean Whether the two active records refer to the same row in the same database table.

db\ActiveRecordInterface deleteAll()

deleteAll() public abstract static method Deletes records 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 abstract static integer deleteAll ( $condition = null )$condition array The condition that matches the records that should get deleted. Please refer to yii\db\QueryInterface::where() on how to specify this param

db\ActiveRecordInterface delete()

delete() public abstract method Deletes the record from the database. public abstract integer|boolean delete ( )return integer|boolean The number of rows deleted, or false if the deletion is unsuccessful for some reason. Note that it is possible that the number of rows deleted is 0, even though the deletion execution is successful.

db\ActiveRecordInterface attributes()

attributes() public abstract method Returns the list of all attribute names of the record. public abstract array attributes ( )return array List of attribute names.

db\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 = '', $params = [] )$counters array The counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters. $condition string|array The conditions that will

db\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], 'status = 2'); public static integer updateAll ( $attributes, $condition = '', $params = [] )$attributes array Attribute values (name-value pairs) to be saved into the table $condition string|array The conditions that will be put in the WHERE part of the UPDA