db\ActiveRelationTrait $primaryModel

$primaryModel public property The primary model of a relational query. This is used only in lazy loading with dynamic query options. public yii\db\ActiveRecord $primaryModel = null

db\ActiveRelationTrait $multiple

$multiple public property Whether this query represents a relation to more than one record. This property is only used in relational context. If true, this relation will populate all query results into AR instances using all(). If false, only the first row of the results will be retrieved using one(). public boolean $multiple = null

db\ActiveRelationTrait $link

$link public property The columns of the primary and foreign tables that establish a relation. The array keys must be columns of the table for this relation, and the array values must be the corresponding columns from the primary table. Do not prefix or quote the column names as this will be done automatically by Yii. This property is only used in relational context. public array $link = null

db\ActiveRelationTrait $inverseOf

$inverseOf public property The name of the relation that is the inverse of this relation. For example, an order has a customer, which means the inverse of the "customer" relation is the "orders", and the inverse of the "orders" relation is the "customer". If this property is set, the primary record(s) will be referenced through the specified relation. For example, $customer->orders[0]->customer and $customer will be the same object, and accessing the customer of an order will not trig

db\ActiveRecordInterface updateAll()

updateAll() public abstract static method Updates records 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 abstract static integer updateAll ( $attributes, $condition = null )$attributes array Attribute values (name-value pairs) to be saved for the record. Unlike update() these are not going to be validated. $condition array The condit

db\ActiveRecordInterface update()

update() public abstract method Saves the changes to this active record into the database. Usage example: $customer = Customer::findOne($id); $customer->name = $name; $customer->email = $email; $customer->update(); public abstract integer|boolean update ( $runValidation = true, $attributeNames = null )$runValidation boolean Whether to perform validation (calling \yii\db\Model::validate()) before saving the record. Defaults to true. If the validation fails, the record will not b

db\ActiveRecordInterface unlink()

unlink() public abstract method Destroys the relationship between two records. The record with the foreign key of the relationship will be deleted if $delete is true. Otherwise, the foreign key will be set null and the record will be saved without validation. public abstract void unlink ( $name, $model, $delete = false )$name string The case sensitive name of the relationship, e.g. orders for a relation defined via getOrders() method. $model static The model to be unlinked from the cur

db\ActiveRecordInterface setAttribute()

setAttribute() public abstract method Sets the named attribute value. See also hasAttribute(). public abstract void setAttribute ( $name, $value )$name string The attribute name. $value mixed The attribute value.

db\ActiveRecordInterface save()

save() public abstract method Saves the current record. This method will call insert() when isNewRecord is true, or update() when isNewRecord is false. For example, to save a customer record: $customer = new Customer; // or $customer = Customer::findOne($id); $customer->name = $name; $customer->email = $email; $customer->save(); public abstract boolean save ( $runValidation = true, $attributeNames = null )$runValidation boolean Whether to perform validation (calling \yii\db\Mod

db\ActiveRecordInterface primaryKey()

primaryKey() public abstract static method Returns the primary key name(s) for this AR class. Note that an array should be returned even when the record only has a single primary key. For the primary key value see getPrimaryKey() instead. public abstract static string[] primaryKey ( )return string[] The primary key name(s) for this AR class.