Hi everyone,

This is the first time I have tried to make a real model for a joining
table and I got really stuck on this seemingly simple thing. I just
cant get it to work. Does anyone know how this file should be named?

I have a HABTM association between two models in a plugin. I have now
created a joining model to be able to capture some callbacks and write
custom "behaviours". Problem is Cake does not load the model but
resorts to creating its magic "empty" model based on AppModel. It does
not even seem to find the model's file.

The facts:

News.NewsMessage habtm News.NewsSubscriber

--- among other things in NewsMessage
'with' => 'News.NewsMessagesNewsSubscriber',
---

--- NewsMessagesNewsSubscriber
debug('NewsMessagesNewsSubscriber file was loaded');
class NewsMessagesNewsSubscriber extends NewsAppModel {
    var $name = 'NewsMessagesNewsSubscriber';
    function afterFind() {
        debug('NewsMessagesNewsSubscriber class was used in a find');
    }
}
---

I have but debug lines straight into the model file to see if it loads
at all and nothing. So I guess I have to name it something special I
can't figure out.

I have tried the following files placed in app/plugins/news/models/
news_messages_news_subscriber.php <-- should be this one, right?
news_message_news_subscriber.php
news_messages_news_subscribers.php

If you know what I should call this file, please reply while I have a
few hairs left on my head ;)
thanks

Martin Westin


--~--~---------~--~----~------------~-------~--~----~
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