What David said. You have to add your conditions to the paginate call.
Check out the google groups FAQ: http://groups.google.com/group/cake-php/web/faq Scroll down to: How to add paginate support for custom queries? On Sep 9, 9:13 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > See:http://groups.google.com/group/cake-php/msg/7d17a42d764ccce4?hl=en > > Your problem is not in your conditions, it's right here: > > > $this->set('textmasters', $this->paginate()); > > Yes, this in fact does give you *everything*. > > On 9 Sep 2008, at 17:04, Liebermann, Anja Carolin wrote: > > > > > Hello, > > > I still have some problems with the parameters for "find" > > > I have two different sets of parameters but I have the impression the > > result doesn't react on them, but simply gives me a list with nearly > > all > > of my datasets: > > > Version 1: > > $params = array( > > 'conditions' => array('Textmaster.katalogobjekt_id' => 1, > > 'Textmaster.sprache_id' => 1, > > 'Textmaster.textinhalt LIKE' => > > '%'.trim($this->data['Textmaster']['textinhalt']).'%', > > 'Textmaster.suchkriterium LIKE' => > > '%'.trim($this->data['Textmaster']['suchkriterium']).'%'), > > 'fields' => > > array > > ('Textmaster.id','Textmaster.suchkriterium','Textmaster.textinhalt' > > ), > > 'order' => 'Textmaster.suchkriterium ASC', > > 'recursive' => -1 > > ); > > > Version 2: > > $params = array( > > 'conditions' => array('Textmaster.katalogobjekt_id' => 1, > > 'Textmaster.sprache_id' => 1), > > 'fields' => > > array > > ('Textmaster.id','Textmaster.suchkriterium','Textmaster.textinhalt' > > ), > > 'order' => 'suchkriterium ASC', > > 'recursive' => -1 > > ); > > > $textmasters = $this->Textmaster->find('all',$params); > > $this->set('textmasters', $this->paginate()); > > > Question 1: What does 'fields' do? I thought it would load only those > > fields, but my dataset seems to load completely because in the view > > every column is populated > > > Question 2: the 'order' criteria is being ignored. Do I have the wrong > > syntax? The result is still sorted by 'id'. > > > Question 3: the "like" condition is also ignored, although it arraives > > in the parameter array: > > E.g.: > > Array > > ( > > [conditions] => Array > > ( > > [Textmaster.katalogobjekt_id] => 1 > > [Textmaster.sprache_id] => 1 > > [Textmaster.textinhalt LIKE] => %Modern% > > [Textmaster.suchkriterium LIKE] => %ACE109% > > ) > > > [fields] => Array > > ( > > [0] => Textmaster.id > > [1] => Textmaster.suchkriterium > > [2] => Textmaster.textinhalt > > ) > > > [order] => Textmaster.suchkriterium ASC > > [recursive] => -1 > > ) > > > Any hints on what is going wrong are appreciated. > > > Anja C. Liebermann --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---