/** * Generates a query string using the same API Model::find() uses, calling the beforeFind process for the model * * @param Model $Model * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) * @return array Array of records * @link http://book.cakephp.org/view/1018/find */ public function getQuery(Model $Model, $type = 'first', $query = array()) { $Model->findQueryType = $type; $Model->id = $Model->getID(); $query = $Model->buildQuery($type, $query); $this->findQueryType = null; return $this->_queryGet($Model, $query); }