CakePHPでのデータ取得の履歴
findAll
$cond =array("Bookmark.user_id" => 1, "Bookmark.created" => ">=2007-01-01"); $field = array("Bookmark.id","Bookmark.url","Bookmark.created"); $order = array("Bookmark.id" => "desc"); $data = $this->Bookmark0>findAll($cond,$field,$order); $this->set("data",$data);
find
$conditions = array("Post.title LIKE" => "%post%"); $conditions = array("Post.date BETWEEN ? AND ?" => array("2008-1-1", "2009-1-1")); $conditions = array("Post.title LIKE ?" => array("%post%")); $conditions = array("Post.id" => array(1,2,3,4,5)); $this->Post->find($conditions);