Created
August 3, 2012 20:40
-
-
Save vitorpacheco/3251320 to your computer and use it in GitHub Desktop.
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
| <?php | |
| class AppModel extends Model { | |
| public function getQuery($type, $options = array()) { | |
| $dbo = $this->getDataSource(); | |
| $defaults = array( | |
| 'fields' => array('`' . $this->alias . '`.`*`'), | |
| 'table' => '"' . $dbo->config['schema'] . '".' . $dbo->fullTableName($this), | |
| 'alias' => $this->alias, | |
| 'limit' => null, | |
| 'offset' => null, | |
| 'joins' => array(), | |
| 'conditions' => array(), | |
| 'order' => array(), | |
| 'group' => array(), | |
| ); | |
| $options = array_merge($defaults, $options); | |
| $query = $dbo->buildStatement($options, $this->{$this->alias}); | |
| return $query; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment