protected function onObjectSaved(Model $object) { if ($object->isNewRecord()) { // Assign an auto number as a unique identifier. $this->autoNumberCount++; $object->UniqueIdentifier = $this->autoNumberCount; } parent::onObjectSaved($object); }
protected function onObjectSaved(Model $object) { // If this is a new object, we need to insert it. if ($object->isNewRecord()) { $this->insertObject($object); } else { $this->updateObject($object); } }
public final function deleteObject(Model $object) { if ($object->isNewRecord()) { return; } $this->onObjectDeleted($object); $this->deleteObjectFromCache($object); }