db\BaseActiveRecord optimisticLock()

optimisticLock() public method Returns the name of the column that stores the lock version for implementing optimistic locking. Optimistic locking allows multiple users to access the same record for edits and avoids potential conflicts. In case when a user attempts to save the record upon some staled data (because another user has modified the data), a yii\db\StaleObjectException exception will be thrown, and the update or deletion is skipped. Optimistic locking is only supported by update(

db\BaseActiveRecord link()

link() public method Establishes the relationship between two models. The relationship is established by setting the foreign key value(s) in one model to be the corresponding primary key value(s) in the other model. The model 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 models. Note that this method requires that

db\BaseActiveRecord markAttributeDirty()

markAttributeDirty() public method Marks an attribute dirty. This method may be called to force updating a record when calling update(), even if there is no change being made to the record. public void markAttributeDirty ( $name )$name string The attribute name

db\BaseActiveRecord isAttributeChanged()

isAttributeChanged() public method Returns a value indicating whether the named attribute has been changed. public boolean isAttributeChanged ( $name, $identical = true )$name string The name of the attribute. $identical boolean Whether the comparison of new and old value is made for identical values using ===, defaults to true. Otherwise == is used for comparison. This parameter is available since version 2.0.4. return boolean Whether the attribute has been changed

db\BaseActiveRecord instantiate()

instantiate() public static method Creates an active record instance. This method is called together with populateRecord() by yii\db\ActiveQuery. It is not meant to be used for creating new records directly. You may override this method if the instance being created depends on the row data to be populated into the record. For example, by creating a record based on the value of a column, you may implement the so-called single-table inheritance mapping. public static static instantiate ( $r

db\BaseActiveRecord isPrimaryKey()

isPrimaryKey() public static method Returns a value indicating whether the given set of attributes represents the primary key for this model public 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\BaseActiveRecord isRelationPopulated()

isRelationPopulated() public method Check whether the named relation has been populated with records. See also getRelation(). public boolean isRelationPopulated ( $name )$name string The relation name, e.g. orders for a relation defined via getOrders() method (case-sensitive). return boolean Whether relation has been populated with records.

db\BaseActiveRecord init()

init() public method Initializes the object. This method is called at the end of the constructor. The default implementation will trigger an EVENT_INIT event. If you override this method, make sure you call the parent implementation at the end to ensure triggering of the event. public void init ( )

db\BaseActiveRecord hasOne()

hasOne() public method Declares a has-one relation. The declaration is returned in terms of a relational yii\db\ActiveQuery instance through which the related record can be queried and retrieved back. A has-one relation means that there is at most one related record matching the criteria set by this relation, e.g., a customer has one country. For example, to declare the country relation for Customer class, we can write the following code in the Customer class: public function getCountry() {

db\BaseActiveRecord hasAttribute()

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