/** * Attempt to load the forum category using the id parameter. * @throws HTTP_Exception */ public function before() { parent::before(); $this->category = ORM::factory('Forum_Category', $this->request->param('id')); if (!$this->category->loaded()) { throw HTTP_Exception::factory('404', 'Forum category not found'); } }
/** * Attempt to load the Topic using the 'ID' parameter in the url. * * @throws HTTP_Exception_404 if topic is not found */ public function before() { parent::before(); $this->topic = ORM::Factory('Forum_Topic', $this->request->param('id')); if (!$this->topic->loaded()) { throw HTTP_Exception::factory('404', 'Forum topic not found'); } }
public function before() { parent::before(); $this->post = ORM::factory('Forum_Post', $this->request->param('id')); if (!$this->post->loaded()) { throw HTTP_Exception::factory('404', 'Forum post not found'); } $this->topic = $this->post->topic; $this->category = $this->topic->category; }