/** * @return boolean */ public function undelete() { try { $this->deleted = 0; self::db()->update($this->table, array('deleted' => 0), $this->getPrimaryKey()); } catch (Exception $e) { ErrorLog::append($e); return false; } return true; }
/** * @return string * @param string $action */ public function run($action) { $class = new ReflectionClass($this); $method = Nano_Dispatcher::formatName($action, false); $result = null; $this->runInit(); if (false !== $this->runBefore()) { try { $result = $this->{$method}(); } catch (Exception $e) { ErrorLog::append($e); throw $e; } } $this->runAfter(); if (false === $this->rendered) { return $this->render(null, null); } return $result; }