Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public final function deleteObject(Model $object)
 {
     if ($object->isNewRecord()) {
         return;
     }
     $this->onObjectDeleted($object);
     $this->deleteObjectFromCache($object);
 }