Пример #1
0
 /**
  * @param CustomerQuery $search
  * @param $searchTerm
  * @param $searchIn
  * @param $searchCriteria
  */
 public function doSearch(&$search, $searchTerm, $searchIn, $searchCriteria)
 {
     $search->_and();
     foreach ($searchIn as $index => $searchInElement) {
         if ($index > 0) {
             $search->_or();
         }
         switch ($searchInElement) {
             case "ref":
                 $search->filterByRef($searchTerm, $searchCriteria);
                 break;
             case "firstname":
                 $search->filterByFirstname($searchTerm, $searchCriteria);
                 break;
             case "lastname":
                 $search->filterByLastname($searchTerm, $searchCriteria);
                 break;
             case "email":
                 $search->filterByEmail($searchTerm, $searchCriteria);
                 break;
         }
     }
 }