Esempio n. 1
0
 /**
  * Get global search string if defined
  * 
  * @return string | null
  */
 public function getGlobalSearch()
 {
     return $this->request->getGlobalSearch();
 }
 /**
  * Process global search
  * 
  * @param Criteria         $criteria
  * @param RequestInterface $request
  */
 protected function processGlobalSearch(Criteria $criteria, RequestInterface $request)
 {
     $query = $request->getGlobalSearch();
     if ($query === null) {
         return;
     }
     $condition = call_user_func_array([Criteria::expr(), 'orX'], array_map(function ($name) use($query) {
         return Criteria::expr()->contains($name, $query);
     }, $this->schemaProvider->getSchema()->getGloballySearchableNames()));
     $criteria->andWhere($condition);
 }