On Tuesday, October 11, 2011 2:23:42 PM UTC+2, cakii wrote: > > hmm, in my project just nothing happens, if i put my code in > AppController::beforeFilter(), just an empty debug: > *app\Controller\AppController.php* (line *14*) > > for a clean app its enough to use latest download in another directory eg > htdocs/test2, right ?! >
Yes, https://github.com/cakephp/cakephp/zipball/2.0 > > > in the meantime i had another strange problem: > > call from CONTROLLER: > $this->Testmodel->id = "11"; > $this->Testmodel->test(); > > MODEL: > $this->id = '11'; > debug($this->find('first', array('fields' => array('ip1', 'ip2')))); > $this->find('first', array('conditions' => array('id'=>11), 'fields' => array('ip1', 'ip2'))); should work. http://book.cakephp.org/2.0/en/models/retrieving-your-data.html?highlight=find%20first#find-first or $this->id = 11; $this->read(array('ip1', 'ip2')); > and the result from debug is: > > [Testmodel] => Array > ( > [ip1] => 1 > [ip2] => 1 > [id] => 0582ef53-f030-11e0-ad60-524e8fe2be12 > ) > > You are using UUIDs for table primary key, read http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html?highlight=uuid#model-and-database-conventions but referring ID's as integer > > but i though if i set id (i know, setting it one time - only in model or > controller - SHOULD be enough..) id should not be generated, only if id is > empty. > But id is set, if i debug it after the find call (the right one, 11 ..). > Of course there is data with id 11 in the database. > The sql query from cakeph is : ... WHERE 1 = 1 > > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
