Newscoop\Service\Model\Search\Search::getAllColumns PHP Метод

getAllColumns() публичный Метод

Provides all the columns registered in this search.
public getAllColumns ( ) : array
Результат array The arrays containing all the Columns registered.
    public function getAllColumns()
    {
        return $this->allColumns;
    }

Usage Example

Пример #1
0
 /**
  * Builds on to the provided query builder the interogations that will reflect the provided search object.
  *
  * @param Search $search
  * 		The search from which the query is build, if the search does not reflect any interogation
  * 		no actions needs to be taken, *(not null not empty).
  *
  * @param QueryBuilder $qb
  * 		The Doctrine query builder to be constructed on, *(not null not empty).
  */
 protected function processInterogation(Search $search, QueryBuilder $qb)
 {
     foreach ($search->getAllColumns() as $column) {
         /** @var $column Newscoop\Service\Model\Search\ColumnOrderLike */
         if ($column instanceof ColumnOrderLike) {
             $like = $column->getLike();
             if (!empty($like)) {
                 $name = $this->map($search, $column);
                 $field = self::ALIAS . '.' . $name;
                 $qb->andWhere($field . ' like :' . $name);
                 $qb->setParameter($name, $like);
             }
         }
     }
 }