I don't think you provided enough info for anyone to help you. 

Please provide the function and point out the line that is getting the error. 

Thanks,
Bill Stoltz

On Nov 13, 2012, at 10:31 PM, "Andrew Johnston [via CakePHP]" 
<ml-node+s1045679n571225...@n5.nabble.com> wrote:

> I know this post gets written every couple of months, and I swear that I've 
> read through all of the back posts, yet can't find a solution that works.
> 
> Whenever I try to call related data from one of my models, I get the above 
> error. Below is the relationship code for each model.
> 
> class Slide extends AppModel {
>       public $name = 'Slide';
>       public $belongsTo =  array(
>       'Module' => array(
>               'className' => 'Module',
>               'foreignKey' => 'module_id',
>               ));
> 
> class Module extends AppModel {
>       public $name = 'Module';
>       public $hasMany = array(
>               'Slide' => array(
>                       'className'  => 'Slide',
>                       'foreignKey' => 'module_id',
>                       'order' => 'Slide.position ASC',
>                       'dependent' => true
>               )
>       );
>       public $belongsTo = array(
>               'Creator' => array(
>                       'className' => 'User'));        
>       public $hasAndBelongsToMany = array(
>               'Learner' => array(
>                  'className'              => 'User',
>            'joinTable'              => 'modules_users',
>            'foreignKey'             => 'module_id',
>            'associationForeignKey'  => 'users_id',
>            'unique'                 => 'keepExisting',
>               ));             
> 
> class User extends AppModel {
>       public $name = 'User';
>       public $uses = 'users';
>       public $hasMany = array(
>               'OModule' => array(
>                       'className' => 'Module',
>                       'foreignKey' => 'users_id',
>                       'order' => 'Module.created DESC'
>                       ));
>       public $hasAndBelongsToMany = array(
>               'Module' => array( //We gotta remember this later...
>                  'className'              => 'Module',
>            'joinTable'              => 'modules_users',
>            'foreignKey'             => 'user_id',
>            'associationForeignKey'  => 'module_id',
>            'unique'                 => 'keepExisting',
>               ));
> 
> I've tried to adhere to all of the requirements outlined in the CookBook, but 
> I know I must be doing something wrong. Any help is appreciated. Thanks in 
> advance.
> 
> Andrew
> -- 
> 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 [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://cakephp.1045679.n5.nabble.com/Yet-another-Call-to-a-member-function-find-on-a-non-object-error-tp5712251.html
> To start a new topic under CakePHP, email 
> ml-node+s1045679n125572...@n5.nabble.com 
> To unsubscribe from CakePHP, click here.
> NAML




--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Yet-another-Call-to-a-member-function-find-on-a-non-object-error-tp5712251p5712254.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
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+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to