Reputation: 699
I'm converting CakePHP 1.2 site to 1.3 and running in a few problems. Since Model::findAll has been removed in 1.3 how do I go about converting this piece of code?
$pages = $this->Page->findAll("category like '{$page['Page']['category']}'",null,'sort_order');
Upvotes: 1
Views: 531
Reputation: 21743
it should be more like
$pages = $this->Page->find('all', array(
'conditions' => array('category LIKE' => $page['Page']['category']),
'order'=>array(...),
'fields'=>array(...)
));
Upvotes: 2
Reputation: 2670
I think it goes something like this.
$pages = $this->Page->find('all', array('conditions' => array('category like ' => '{$page['Page']['category']})));
Upvotes: -1