where() public method

If you use an array in $column_name, a new clause will be added for each element. In this case, $value is ignored.
public where ( $column_name, $value = null )
Esempio n. 1
0
 /**
  * @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;
 }
Esempio n. 2
0
 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);
         }
     }
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 /**
  * 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();
 }
Esempio n. 5
0
 public function before_fetch(ORM $item)
 {
     $item->where('static', '=', true);
     return parent::before_fetch($item);
 }
Esempio n. 6
0
 protected function before_fetch(ORM $item)
 {
     $item->where('parent_id', 'IS', NULL);
     return parent::before_fetch($item);
 }