public function save() { $this->modified = time(); if (!$this->getId()) { $this->created = $this->modified; } parent::save(); }
public function isAfter(Model_Ordered $target) { return $target->order < $this->order or $target->order == $this->order and $target->getId() < $this->getId(); }
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(); } } }