db\ActiveRecordInterface populateRelation()

populateRelation() public abstract method (available since version 2.0.8) Populates the named relation with the related records. Note that this method does not check if the relation exists or not. public abstract void populateRelation ( $name, $records )$name string The relation name, e.g. orders for a relation defined via getOrders() method (case-sensitive). $records yii\db\ActiveRecordInterface|array|null The related records to be populated into the relation.

db\ActiveRecordInterface link()

link() public abstract method Establishes the relationship between two records. The relationship is established by setting the foreign key value(s) in one record to be the corresponding primary key value(s) in the other record. The record with the foreign key will be saved into database without performing validation. If the relationship involves a junction table, a new row will be inserted into the junction table which contains the primary key values from both records. This method requires

db\ActiveRecordInterface isPrimaryKey()

isPrimaryKey() public abstract static method Returns a value indicating whether the given set of attributes represents the primary key for this model public abstract static boolean isPrimaryKey ( $keys )$keys array The set of attributes to check return boolean Whether the given set of attributes represents the primary key for this model

db\ActiveRecordInterface insert()

insert() public abstract 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 abstract boolean insert ( $runValidation = true, $attributes = 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 be

db\ActiveRecordInterface hasAttribute()

hasAttribute() public abstract method Returns a value indicating whether the record has an attribute with the specified name. public abstract boolean hasAttribute ( $name )$name string The name of the attribute return boolean Whether the record has an attribute with the specified name.

db\ActiveRecordInterface getRelation()

getRelation() public abstract method Returns the relation object with the specified name. A relation is defined by a getter method which returns an object implementing the yii\db\ActiveQueryInterface (normally this would be a relational yii\db\ActiveQuery object). It can be declared in either the ActiveRecord class itself or one of its behaviors. public abstract yii\db\ActiveQueryInterface getRelation ( $name, $throwException = true )$name string The relation name, e.g. orders for a rela

db\ActiveRecordInterface getPrimaryKey()

getPrimaryKey() public abstract method Returns the primary key value(s). public abstract mixed getPrimaryKey ( $asArray = false )$asArray boolean Whether to return the primary key value as an array. If true, the return value will be an array with attribute names as keys and attribute values as values. Note that for composite primary keys, an array will always be returned regardless of this parameter value. return mixed The primary key value. An array (attribute name => attribute val

db\ActiveRecordInterface getOldPrimaryKey()

getOldPrimaryKey() public abstract method Returns the old primary key value(s). This refers to the primary key value that is populated into the record after executing a find method (e.g. find(), findOne()). The value remains unchanged even if the primary key attribute is manually assigned with a different value. public abstract mixed getOldPrimaryKey ( $asArray = false )$asArray boolean Whether to return the primary key value as an array. If true, the return value will be an array with c

db\ActiveRecordInterface getIsNewRecord()

getIsNewRecord() public abstract method Returns a value indicating whether the current record is new (not saved in the database). public abstract boolean getIsNewRecord ( )return boolean Whether the record is new and should be inserted when calling save().

db\ActiveRecordInterface getDb()

getDb() public abstract static method Returns the connection used by this AR class. public abstract static mixed getDb ( )return mixed The database connection used by this AR class.