Пример #1
0
 public function getFilters($source)
 {
     $parentFilters = parent::getFilters($source);
     $filters = array();
     foreach ($parentFilters as $filter) {
         $filters[] = $filter->getValue() === null ? $filter : $filter->setValue(new \DateTime($filter->getValue()));
     }
     return $filters;
 }
Пример #2
0
 public function getFilters($source)
 {
     $parentFilters = parent::getFilters($source);
     $filters = array();
     foreach ($parentFilters as $filter) {
         switch ($filter->getOperator()) {
             case self::OPERATOR_ISNULL:
                 $filters[] = new Filter(self::OPERATOR_ISNULL);
                 $filters[] = new Filter(self::OPERATOR_EQ, '');
                 $this->setDataJunction(self::DATA_DISJUNCTION);
                 break;
             case self::OPERATOR_ISNOTNULL:
                 $filters[] = new Filter(self::OPERATOR_ISNOTNULL);
                 $filters[] = new Filter(self::OPERATOR_NEQ, '');
                 break;
             default:
                 $filters[] = $filter;
         }
     }
     return $filters;
 }
Пример #3
0
 public function getFilters($source)
 {
     $parentFilters = parent::getFilters($source);
     $filters = array();
     foreach ($parentFilters as $filter) {
         switch ($filter->getOperator()) {
             case self::OPERATOR_EQ:
             case self::OPERATOR_NEQ:
                 $filterValues = (array) $filter->getValue();
                 $value = '';
                 $counter = 1;
                 foreach ($filterValues as $filterValue) {
                     $len = strlen($filterValue);
                     $value .= 'i:' . $counter++ . ';s:' . $len . ':"' . $filterValue . '";';
                 }
                 $filters[] = new Filter($filter->getOperator(), 'a:' . count($filterValues) . ':{' . $value . '}');
                 break;
             case self::OPERATOR_LIKE:
             case self::OPERATOR_NLIKE:
                 $len = strlen($filter->getValue());
                 $value = 's:' . $len . ':"' . $filter->getValue() . '";';
                 $filters[] = new Filter($filter->getOperator(), $value);
                 break;
             case self::OPERATOR_ISNULL:
                 $filters[] = new Filter(self::OPERATOR_ISNULL);
                 $filters[] = new Filter(self::OPERATOR_EQ, 'a:0:{}');
                 $this->setDataJunction(self::DATA_DISJUNCTION);
                 break;
             case self::OPERATOR_ISNOTNULL:
                 $filters[] = new Filter(self::OPERATOR_ISNOTNULL);
                 $filters[] = new Filter(self::OPERATOR_NEQ, 'a:0:{}');
                 break;
             default:
                 $filters[] = $filter;
         }
     }
     return $filters;
 }
Пример #4
0
 public function getFilters($source)
 {
     $parentFilters = parent::getFilters($source);
     $filters = array();
     foreach ($parentFilters as $filter) {
         // Transforme in number for ODM
         $filters[] = $filter->getValue() === null ? $filter : $filter->setValue($filter->getValue() + 0);
     }
     return $filters;
 }