Ejemplo n.º 1
0
 public function save()
 {
     $this->modified = time();
     if (!$this->getId()) {
         $this->created = $this->modified;
     }
     parent::save();
 }
Ejemplo n.º 2
0
 public function isAfter(Model_Ordered $target)
 {
     return $target->order < $this->order or $target->order == $this->order and $target->getId() < $this->getId();
 }
Ejemplo n.º 3
0
Archivo: Tree.php Proyecto: kstep/pnut
 public function remove($recursive = false)
 {
     if ($recursive) {
         $children = $this->getDescendantsId();
         $this->_db->delete($this->_table, array($this->_pk => $children));
         parent::remove();
     } else {
         $children = $this->getChildren();
         if (count($children)) {
             throw new Model_Exception("Can't remove non-leaf tree item");
         } else {
             parent::remove();
         }
     }
 }