Can't we also load behaviors same way?
Inside /app/models/video.php
var $actsAs = array('Upload' => array('field' => 'video',
'type' => 'video',
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
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'))
>
>
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
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
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
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