Created
January 21, 2012 16:38
-
-
Save tayfunoziserikan/1653233 to your computer and use it in GitHub Desktop.
Search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $searchQuery = Doctrine_Core::getTable('Model_Entity_City') | |
| ->search($this->_request->query); | |
| $searchIds = array(); | |
| foreach ($searchQuery as $result) { | |
| $searchIds[] = $result['id']; | |
| } | |
| // DQL | |
| $query = Doctrine_Query::create() | |
| ->from('Model_Entity_City c') | |
| ->whereIn('c.id', $searchIds) | |
| ->orderBy("c.id ASC") | |
| ->useQueryCache(Kebab_Cache_Query::isEnable()); | |
| // Pager | |
| $responseData = $query->execute()->toArray(); | |
| $this->_helper->response(true)->addTotal(count($responseData))->addData($responseData)->getResponse(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment