Example #1
0
 public function afterSave($insert, $changedAttributes)
 {
     parent::afterSave($insert, $changedAttributes);
     $this->calculateItemsLeft($changedAttributes);
     $log = new Log();
     if ($insert) {
         $log->saveDatabaseOperation('create', $this->tableName(), $this->id);
     } else {
         $log->saveDatabaseOperation('update', $this->tableName(), $this->id);
     }
 }
Example #2
0
 public function afterDelete()
 {
     parent::afterDelete();
     $log = new Log();
     $log->saveDatabaseOperation('delete', $this->tableName(), $this->name);
 }