Re: Why custom model functions inside plugin models are not called?

2008-04-23 Thread Max
Can't we also load behaviors same way? Inside /app/models/video.php var $actsAs = array('Upload' => array('field' => 'video', 'type' => 'video',

Re: Why custom model functions inside plugin models are not called?

2008-04-23 Thread Max
Great info... Thanks a lot. On Apr 22, 11:38 pm, biesbjerg <[EMAIL PROTECTED]> wrote: > I'll bet echo get_class($this->Review) will output 'AppModel'. > > The reason is you need to define $uses like this when accessing plugin > models: > > var $uses = array('User', 'Reviews.Review'); > > You shou

Re: Why custom model functions inside plugin models are not called?

2008-04-23 Thread aranworld
Thanks. I knew I was doing something slightly wrong, but since what I had worked, I sort of left it alone. -Aran On Apr 22, 2:14 pm, biesbjerg <[EMAIL PROTECTED]> wrote: > Hi Aranworld, > > You should use > > var $belongsTo = array('Comment' => array('className' => > 'PluginName.Comment')) > >

Re: Why custom model functions inside plugin models are not called?

2008-04-22 Thread biesbjerg
Hi Aranworld, You should use var $belongsTo = array('Comment' => array('className' => 'PluginName.Comment')) On Apr 22, 9:02 pm, aranworld <[EMAIL PROTECTED]> wrote: > Here is what I had to do: > > in pluginname/models/article.php > > App::import('Model', 'Pluginname.Comment'); > > class Artic

Re: Why custom model functions inside plugin models are not called?

2008-04-22 Thread aranworld
Here is what I had to do: in pluginname/models/article.php App::import('Model', 'Pluginname.Comment'); class Article extends PluginnameModel { $belongsTo = array('Comment'); } Now in pluginname/controllers/articles_controller.php I do $uses = array('Pluginname.Article'); On Apr 21

Re: Why custom model functions inside plugin models are not called?

2008-04-22 Thread biesbjerg
I'll bet echo get_class($this->Review) will output 'AppModel'. The reason is you need to define $uses like this when accessing plugin models: var $uses = array('User', 'Reviews.Review'); You should do the same when creating associations within the plugin's models: PluginName.ModelName. Good

Why custom model functions inside plugin models are not called?

2008-04-21 Thread Max
Consider a scenario: In file /app/controllers/users_controller.php //review is the plugin model which is here: /app/plugins/reviews/ models/review.php var $uses = array('User', 'Review'); function getUserReviews() { $reviews = $this->Review->getRecent(); //this will throw sql error.. any