db\BaseActiveRecord __get()

__get() public method PHP getter magic method. This method is overridden so that attributes and related objects can be accessed like properties. See also getAttribute(). public mixed __get ( $name )$name string Property name return mixed Property value throws yii\base\InvalidParamException if relation name is wrong

db\BaseActiveRecord __set()

__set() public method PHP setter magic method. This method is overridden so that AR attributes can be accessed like properties. public void __set ( $name, $value )$name string Property name $value mixed Property value

db\BaseActiveRecord updateInternal()

updateInternal() protected method See also update(). protected integer|false updateInternal ( $attributes = null )$attributes array Attributes to update return integer|false The number of rows affected, or false if beforeSave() stops the updating process. throws yii\db\StaleObjectException

db\BaseActiveRecord updateAttributes()

updateAttributes() public method Updates the specified attributes. This method is a shortcut to update() when data validation is not needed and only a small set attributes need to be updated. You may specify the attributes to be updated as name list or name-value pairs. If the latter, the corresponding attribute values will be modified accordingly. The method will then save the specified attributes into database. Note that this method will not perform data validation and will not trigger ev

db\BaseActiveRecord updateCounters()

updateCounters() public method Updates one or several counter columns for the current AR object. Note that this method differs from updateAllCounters() in that it only saves counters for the current AR object. An example usage is as follows: $post = Post::findOne($id); $post->updateCounters(['view_count' => 1]); See also updateAllCounters(). public boolean updateCounters ( $counters )$counters array The counters to be updated (attribute name => increment value) Use negative val

db\BaseActiveRecord 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 = '' )$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 be put in the

db\BaseActiveRecord 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 = '' )$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 UPDATE SQL. Please

db\BaseActiveRecord update()

update() public method Saves the changes to this active record into the associated database table. This method performs the following steps in order: call beforeValidate() when $runValidation is true. If beforeValidate() returns false, the rest of the steps will be skipped; call afterValidate() when $runValidation is true. If validation failed, the rest of the steps will be skipped; call beforeSave(). If beforeSave() returns false, the rest of the steps will be skipped; save the record into

db\BaseActiveRecord unlink()

unlink() public method Destroys the relationship between two models. The model with the foreign key of the relationship will be deleted if $delete is true. Otherwise, the foreign key will be set null and the model will be saved without validation. public 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 yii\db\ActiveRecordInterface The model to be unlinked from the cu

db\BaseActiveRecord unlinkAll()

unlinkAll() public method Destroys the relationship in current model. The model with the foreign key of the relationship will be deleted if $delete is true. Otherwise, the foreign key will be set null and the model will be saved without validation. Note that to destroy the relationship without removing records make sure your keys can be set to null public void unlinkAll ( $name, $delete = false )$name string The case sensitive name of the relationship, e.g. orders for a relation defined