Hi all!

I have one problem with the methode saveAll. I do a saveAll and i have this 
error :

SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "body" 
violates not-null constraint

Here, my models :

class Topic extends AppModel {
    public $name = 'Topic';
    public $belongsTo = 'User';
    public $hasMany = array('Belong', 'Message');

class Message extends AppModel {
    public $name = 'Message';
    
    public $belongsTo = array('User', 'Topic');

class Belong extends AppModel {
    public $name = 'Belong';
    
    public $belongsTo = array('User', 'Topic');
       
}

I use saveAll inside the model Topic, here the array transmitted at my 
method.


Array ( [Topic] => 
 Array ( 
   [subject] => ZEZEEZ 
   [user_id] => 3 ) 

[Message] => Array ( 
  [body] => QSDDDDDDDDDDD 
  [user_id] => 3 )

[Belong] => Array (
   [user_id] => 3 ) )

Request :


$this->Topic->saveAll($this->request->data);

My body's field is filled !

Thanks guys!

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to