/** * @return ORM */ protected function before_fetch(ORM $item) { if (is_null($this->_parent_key)) { throw new Extasy_Exception('Parent key not defined'); } $item->where($this->_parent_key, '=', $this->param('parent')); return $item; }
public static function exclude_hidden(ORM $orm, $is_master_site) { if (!$is_master_site) { $hided_list = ORM::factory('hided_List')->where('object_name', '=', $orm->object_name())->find_all()->as_array(NULL, 'element_id'); if (!empty($hided_list)) { $orm->where($orm->primary_key(), 'NOT IN', $hided_list); } } }
public function before_fetch(ORM $item) { if (isset($_GET['cancel_filter'])) { $this->redirect('/' . Extasy_Url::url_to_route($this->get_index_route())); } $filter_form = new Form_Filter_Category($item); if (isset($_GET['filter'])) { $filter_form->submit(); } $this->template->filter_form = $filter_form; $item->where('parent_id', 'IS', NULL); return parent::before_fetch($item); }
/** * Read operation * * @param int $id * @return ORM */ public function read($id) { return $this->orm->where($this->orm->object_name() . '.' . $this->orm->primary_key(), '=', $id)->find(); }
public function before_fetch(ORM $item) { $item->where('static', '=', true); return parent::before_fetch($item); }
protected function before_fetch(ORM $item) { $item->where('parent_id', 'IS', NULL); return parent::before_fetch($item); }