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 luck.

On Apr 22, 12:59 am, Max <[EMAIL PROTECTED]> wrote:
> 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.. anyone knows a reason? findAll() still works
>
> }
>
> On the other hand, if in bootstrap.php, I manually modify $modelPaths
> array to add the model location. It works just fine. I dont like this
> hack however...
>
> uses('Folder');
> $Folder =& new Folder(APP.'plugins');
> $plugins = $Folder->ls();
>
> foreach($plugins[0] as $plugin)
> {
>         array_push($modelPaths, APP.DS.'plugins'.DS.$plugin.DS.'models'.DS);
>
> }
>
> Abhimanyu
--~--~---------~--~----~------------~-------~--~----~
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