Thursday, January 17, 2013

Associated model object not linked during model test.

Hi,

If I have a hasMany association for my plugin's model, then it's not being linked to the model during execution of a test.

class User extends AggAppModel
   public $name = 'User';
   public $hasMany=>array('Agg.Profile');
   public function doSomething()
   {
       $this->Profile->find('all');
   }
}


The $this->Profile>find(..) will cause a member function find() on a non-object. In the debugger for $this it has no associated model object attached to it.

Why?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
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 cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate