yii\db\ActiveRecordInterface::delete PHP Method

delete() public method

Deletes the record from the database.
public delete ( ) : integer | boolean
return integer | boolean the number of rows deleted, or `false` if the deletion is unsuccessful for some reason. Note that it is possible that the number of rows deleted is 0, even though the deletion execution is successful.
    public function delete();

Usage Example

Esempio n. 1
0
 /**
  * Delete slave record
  *
  * @param ActiveRecordInterface $slave
  */
 protected function deleteSlave(ActiveRecordInterface $slave)
 {
     if ($slave->delete() == false) {
         if (is_callable($this->errorDeleteCallback)) {
             call_user_func($this->errorDeleteCallback, $slave);
         }
     }
 }
All Usage Examples Of yii\db\ActiveRecordInterface::delete