Пример #1
0
 /**
  * Add Like where couse for query
  * @param Db_Select | Zend_Seb_Select $sql
  * @param string $query
  */
 protected function _queryAddQuery($sql, $query)
 {
     $searchFields = $this->_objectConfig->getSearchFields();
     if (empty($searchFields)) {
         return;
     }
     $first = true;
     $q = array();
     foreach ($searchFields as $v) {
         $q[] = $this->table() . "." . $v . " LIKE(" . $this->_db->quote('%' . $query . '%') . ")";
     }
     $sql->where('(' . implode(' OR ', $q) . ')');
 }