Do you have a User model?

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 22 Sep 2010, at 12:53, psybear83 wrote:

> Hi everybody
> 
> I have overtaken a CakePHP application which used an out-dated version
> of CakePHP (1.2.0.x), so I upgraded it to 1.2.8. Everything worked
> fine before, but now I have problems with HABTM relations:
> 
> $authors = $this->Medium->Author->find('list', array('order' =>
> 'Author.name'));
> 
> results in
> 
> Fatal error: Call to a member function find() on a non-object in /
> Users/josh/Sites/ziviapps/app/controllers/media_controller.php on line
> 57
> 
> My models:
> 
> class Author extends AppModel {
>       var $name = 'Author';
>       var $hasAndBelongsToMany = array(
>               'Medium' => array(
>                       'className' => 'Medium'
>                       ,'unique' => true
>                       ,'order' => 'Medium.name ASC'
>               )
>       );
> }
> 
> class Medium extends AppModel {
>       var $name = 'Medium';
>       var $hasAndBelongsToMany = array(
>               'Author' => array(
>                       'className' => 'Author'
>                       ,'unique' => true
>                       ,'order' => 'Author.name ASC'
>               )
>       );
> )
> 
> Anyone has an idea on how to fix this? I'm trying to do it myself, but
> I'm quite new to CakePHP and haven't done anything with PHP for 4 or 5
> years now...
> 
> Thanks a lot
> Josh
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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

Reply via email to