db\BaseActiveRecord EVENT_AFTER_UPDATE

EVENT_AFTER_UPDATE event of type yii\db\AfterSaveEvent An event that is triggered after a record is updated.

db\BaseActiveRecord EVENT_AFTER_REFRESH

EVENT_AFTER_REFRESH event of type yii\base\Event (available since version 2.0.8) An event that is triggered after a record is refreshed.

db\BaseActiveRecord EVENT_BEFORE_DELETE

EVENT_BEFORE_DELETE event of type yii\base\ModelEvent An event that is triggered before deleting a record. You may set yii\base\ModelEvent::$isValid to be false to stop the deletion.

db\BaseActiveRecord EVENT_AFTER_DELETE

EVENT_AFTER_DELETE event of type yii\base\Event An event that is triggered after a record is deleted.

db\BaseActiveRecord EVENT_AFTER_FIND

EVENT_AFTER_FIND event of type yii\base\Event An event that is triggered after the record is created and populated with query result.

db\BaseActiveRecord EVENT_AFTER_INSERT

EVENT_AFTER_INSERT event of type yii\db\AfterSaveEvent An event that is triggered after a record is inserted.

db\BaseActiveRecord equals()

equals() public method Returns a value indicating whether the given active record is the same as the current one. The comparison is made by comparing the table names and the primary key values of the two active records. If one of the records is new they are also considered not equal. public boolean equals ( $record )$record yii\db\ActiveRecordInterface Record to compare to return boolean Whether the two active records refer to the same row in the same database table.

db\BaseActiveRecord deleteAll()

deleteAll() public static method Deletes rows in the table 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 static integer deleteAll ( $condition = '', $params = [] )$condition string|array The conditions that will be put in the WHERE part of the DELETE SQL. Please refer to yii\db\Query::where() on how to specify t

db\BaseActiveRecord delete()

delete() public method Deletes the table row corresponding to this active record. This method performs the following steps in order: call beforeDelete(). If the method returns false, it will skip the rest of the steps; delete the record from the database; call afterDelete(). In the above step 1 and 3, events named EVENT_BEFORE_DELETE and EVENT_AFTER_DELETE will be raised by the corresponding methods. public integer|false delete ( )return integer|false The number of rows deleted, or fal

db\BaseActiveRecord beforeSave()

beforeSave() public method This method is called at the beginning of inserting or updating a record. The default implementation will trigger an EVENT_BEFORE_INSERT event when $insert is true, or an EVENT_BEFORE_UPDATE event if $insert is false. When overriding this method, make sure you call the parent implementation like the following: public function beforeSave($insert) { if (parent::beforeSave($insert)) { // ...custom code here... return true; } else { ret