/** * * @return Ajde_Model */ public function getItem() { if ($this->isNew()) { $this->fireCrudLoadedOnModel($this->getModel()); return $this->getModel(); } if (!$this->getModel()->getPK()) { $model = $this->getModel(); if (!$model->loadByPK($this->getId())) { Response::redirectNotFound(); } else { if (!$model->getAutoloadParents()) { $model->loadParents(); } } $this->fireCrudLoadedOnModel($this->getModel()); } return $this->getModel(); }
public static function routingError(Exception $exception) { if (Config::get("debug") === true) { throw $exception; } else { if (Autoloader::exists('Ajde_Exception_Log')) { Log::logException($exception); } Response::redirectNotFound(); } }