예제 #1
0
파일: Model.php 프로젝트: vgrish/dvelum
 /**
  * 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) . ')');
 }