Example #1
0
 /**
  * Apply user filter.
  */
 protected function applyUserFilter()
 {
     //получили данные о текущем фильтре
     if ($f = FilterExpression::createFromPOST()) {
         //Добавили к фильтру новое условие
         $f->add((new FilterField('u_name'))->setValue($f->current()->getValue())->setCondition('like')->setAttribute('tableName', $this->getTableName()));
         //и применили
         //в результате получилось что то типа
         //(shop_goods_translation.goods_name LIKE '%условие%' ) OR (shop_goods.goods_code LIKE '%условие%' )"
         //inspect((string)$f);
         (new Filter($f))->apply($this);
     }
 }
Example #2
0
 /**
  * Apply user filter.
  */
 protected function applyUserFilter()
 {
     (new Filter(FilterExpression::createFromPOST()))->apply($this);
 }