Exemple #1
0
 protected function applyParameter($name, $value, $query)
 {
     // typical with inactive lookup
     // make sure we don't get the the 'no fallback strategy' exception
     if ($name == 'with_inactive') {
         if (!$value) {
             $query->where('active', true);
         }
         return $query;
     }
     // testing joins addition
     switch ($name) {
         case 'adding_joins':
         case 'no_duplicate_joins':
             $this->addJoin('UNIQUE_JOIN_KEY', ['test_related_models', 'test_related_models.id', '=', 'test_simple_models.test_related_model_id']);
             $query->where($name, '=', $value);
             return $query;
     }
     parent::applyParameter($name, $value, $query);
 }
 /**
  * Constructs the relevant FilterData if one is not injected
  *
  * @param array|Arrayable|FilterDataInterface $data
  */
 public function __construct($data)
 {
     parent::__construct($data);
     $this->countStrategies = $this->countStrategies();
 }
 /**
  * @inheritdoc
  */
 protected function applyParameter($name, $value, $query)
 {
     parent::applyParameter($name, $value, $query);
 }