Beispiel #1
0
 protected function fetchConditions()
 {
     parent::fetchConditions();
     $this->publishableFetchConditions();
     $filter_keyword = $this->getState('filter.keyword');
     if ($filter_keyword && is_string($filter_keyword)) {
         $key = new \MongoRegex('/' . $filter_keyword . '/i');
         $where = array();
         $where[] = array('title' => $key);
         $where[] = array('slug' => $key);
         $where[] = array('description' => $key);
         $where[] = array('code' => $key);
         $this->setCondition('$or', $where);
     }
     $filter_code = $this->getState('filter.code');
     if (strlen($filter_code)) {
         //$key = new \MongoRegex('/'.$filter_code.'/i');
         $key = strtolower($filter_code);
         // add $and conditions to the query stack
         if (!($and = $this->getCondition('$and'))) {
             $and = array();
         }
         $and[] = array('$or' => array(array('code' => $key), array('codes.list.code' => $key)));
         $this->setCondition('$and', $and);
     }
     $filter_automatic = $this->getState('filter.automatic');
     if (strlen($filter_automatic)) {
         $this->setCondition('usage_automatic', $filter_automatic);
     }
 }
Beispiel #2
0
 protected function fetchConditions()
 {
     parent::fetchConditions();
     $filter_keyword = $this->getState('filter.keyword');
     if ($filter_keyword && is_string($filter_keyword)) {
         $key = new \MongoRegex('/' . $filter_keyword . '/i');
         $where = array();
         $regex = '/^[0-9a-z]{24}$/';
         if (preg_match($regex, (string) $filter_keyword)) {
             $where[] = array('_id' => new \MongoId((string) $filter_keyword));
         }
         $where[] = array('slug' => $key);
         $where[] = array('title' => $key);
         $where[] = array('copy' => $key);
         $where[] = array('description' => $key);
         $where[] = array('metadata.creator.name' => $key);
         $this->setCondition('$or', $where);
     }
     $filter_copy_contains = $this->getState('filter.copy-contains');
     if (strlen($filter_copy_contains)) {
         $key = new \MongoRegex('/' . $filter_copy_contains . '/i');
         $this->setCondition('copy', $key);
     }
     $this->publishableFetchConditions();
     return $this;
 }
Beispiel #3
0
 protected function fetchConditions()
 {
     parent::fetchConditions();
     $filter_namespace = $this->getState('filter.namespace');
     if (strlen($filter_namespace)) {
         $this->setCondition('namespace', $filter_namespace);
     }
     return $this;
 }
Beispiel #4
0
 protected function fetchConditions()
 {
     parent::fetchConditions();
     $this->ancestorsFetchConditions();
     $this->publishableFetchConditions();
 }
Beispiel #5
0
 protected function fetchConditions()
 {
     parent::fetchConditions();
     $filter_keyword = $this->getState('filter.keyword');
     if ($filter_keyword && is_string($filter_keyword)) {
         $key = new \MongoRegex('/' . $filter_keyword . '/i');
         $where = array();
         $where[] = array('title' => $key);
         $where[] = array('slug' => $key);
         $where[] = array('metadata.creator.name' => $key);
         $where[] = array('md5' => $key);
         $this->setCondition('$or', $where);
     }
     $filter_content_type = $this->getState('filter.content_type');
     if (strlen($filter_content_type)) {
         $key = new \MongoRegex('/' . $filter_content_type . '/i');
         $this->setCondition('contentType', $key);
     }
     $filter_storage = $this->getState('filter.storage');
     if (strlen($filter_storage)) {
         $this->setCondition('storage', $filter_storage);
     }
     return $this;
 }
 protected function fetchConditions()
 {
     parent::fetchConditions();
     return $this;
 }
Beispiel #7
0
 protected function fetchConditions()
 {
     $this->imagesFetchConditions();
     parent::fetchConditions();
 }