php - Cakephp 2.0 returns empty, but running produced query in DB produces correct results -
so in controller have simply:
$this->loadmodel('group'); $this->group->recursive = -1; $group = $this->group->findbyname($joingroup); debug($group); debug($this->group->findbyname('temp'));
neither of debugs return empty array.
i have in core set configure::write('debug', 2); sql queries produce is:
select * `groups` `group` `group`.`name` = 'temp' limit 1
note: changes columns * spare list :)
when run query in mysql command shell 1 result expecting. group name of temp.
why cake not returning same query? have set make cake not return results?
in group model have basically:
public $hasmany = array( 'usagehistory' => array( 'classname' => 'usagehistory', 'foreignkey' => 'group_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderquery' => '', 'counterquery' => '' ), 'user' => array( 'classname' => 'user', 'foreignkey' => 'group_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderquery' => '', 'counterquery' => '' ) );
let me know if more information needed!
Comments
Post a Comment