/**
  * @param array $columns incoming column request
  * @param QueryConfigurationBuilder $builder
  * @param ColumnConfiguration $column
  * @param integer $position position of the column in the columnConfiguration loop
  */
 private function addColumnSearchToBuilderIfRequested($columns, $builder, $column, $position)
 {
     if ($column->getSearch()->isSearchable()) {
         // search for this column is available
         $value = $columns[$position]['search']['value'];
         if (!$this->isEmpty($value)) {
             $builder->columnSearch($column->getName(), $value);
         }
     }
 }
 /**
  * @param ParameterBag $query
  * @param QueryConfigurationBuilder $builder
  * @param ColumnConfiguration $column
  * @param integer $position position of the column in the columnConfiguration loop
  */
 private function addColumnSearchToBuilderIfRequested($query, $builder, $column, $position)
 {
     $query_key = 'sSearch_' . $position;
     if ($column->getSearch()->isSearchable() && $query->has($query_key) && !$this->isEmpty($query->get($query_key))) {
         $builder->columnSearch($column->getName(), $query->get($query_key));
     }
 }
 /**
  * Create the query w/ QueryBuilder
  * @param ColumnConfiguration $column
  * @param $searchValue
  * @return QueryBuilder
  * @throws DatatableException
  */
 private function createQueryForColumn(ColumnConfiguration $column, $searchValue)
 {
     $searchType = $column->getSearch();
     if ($searchType == DefaultSearchable::NONE()) {
         // Don't do anything, this is not a searchable field
         return $this->query;
     } elseif ($searchType == DefaultSearchable::NORMAL()) {
         $this->query->orWhere($column->getName(), 'LIKE', '%' . $searchValue . '%');
     } elseif ($searchType == DefaultSearchable::REGEX()) {
         $this->query->orWhere($column->getName(), 'REGEXP', $searchValue);
     } else {
         throw new DatatableException('An unsupported DefaultSearchable was provided.');
     }
     return $this->query;
 }