Re: paginate conditions hasMany question

2011-03-29 Thread hunny
Try following $this->Member->bindModel(array('hasOne' => array('Payment')), false); $this->Member->unbindModel(array('hasMany' => array('Payment')), false); $this->paginate['Member']['contain'] = array('Payment') // make sure Member Model actAs Containable $resul

paginate conditions hasMany question

2011-03-29 Thread heohni
Hi, I struggle... I have the following statement: $list = $this->paginate('Member'); Which returns an array (in short) like this: Array ( [0] => Array ( [Member] => Array ( [id] => 5 ) [Payment] => Array

Re: hasMany question

2009-07-17 Thread Carlos Lavin
Merely a wrapper for find... more documentation about it on: http://api.cakephp.org/class/model 2009/7/16 fedekun > > Thanks! Hmm is there a way to do that on read instead of find? > I have... $this->Post->read(null, $id); > I cant find documentationfor read method though..i just find about > "f

Re: hasMany question

2009-07-16 Thread fedekun
Thanks! Hmm is there a way to do that on read instead of find? I have... $this->Post->read(null, $id); I cant find documentationfor read method though..i just find about "find", "findAll" etc... On 16 jul, 10:59, Carlos Gonzalez Lavin wrote: > A thorough read of the cookbook is always a good pla

Re: hasMany question

2009-07-16 Thread Carlos Gonzalez Lavin
A thorough read of the cookbook is always a good place to start I have never tried sorting by two fields, but how about: *$this->Post->find('all',array('order' => array('Post.created ASC', 'Comment.created DESC')));* if that doesnt work: *$this->Post->find('all',array('order' => 'Post.created AS

Re: hasMany question

2009-07-16 Thread Domenico Testa
On Jul 16, 6:16 am, fedekun wrote: > Hi! I have just started with CakePHP and it seems very good so far! > But i have a little question... i have a Post model, each post > "hasMany" comments, and comments "belongsTo" a Post. > If i want to order posts ASC and > comments DESC...How do i do it? I

hasMany question

2009-07-15 Thread fedekun
Hi! I have just started with CakePHP and it seems very good so far! But i have a little question... i have a Post model, each post "hasMany" comments, and comments "belongsTo" a Post. So, recursive in the Post model is default, so when i do $this->Post->find('all'); I get all posts and comments, n

Re: hasMany question

2008-01-26 Thread WebSpin.Biz
Did you even attempt to READ the manual section on findAll parameters before posting this?? Or the API? Go back to manual, do not pass go.. do not collect $200. Model Methods, Retrieving your data: http://tempdocs.cakephp.org/#TOC66452 On Jan 26, 1:12 am, bob <[EMAIL PROTECTED]> wrote: > i

hasMany question

2008-01-25 Thread bob
i have a User table with 'id' and 'name' columns, and a Email table with 'user_id' and 'email' columns. if i have User hasMany Email, and in my UsersController, i do $this->User->findByEmail(...), it returns all of 'id', 'name', 'user_id', and 'email' columns. how do i make it so that it only retu