Monday, July 5, 2010

Re: use model in behaviour

On Mon, Jul 5, 2010 at 6:28 AM, Melanie Sommer
<melanie-sommer@mailinator.com> wrote:
>> Which callback?
> BeforeFind, but is that important?

Yes, because I wanted to know if it was, in fact, some custom method
of yours. As it's beforeFind() we know that the model is passed in by
Cake.

>> The  model instance is passed to the callbacks
> I know, but I do not want to use that model of the callback but a
> different model - and this is not passed to the callback.

Are they associated? If so, $Model->AssociatedModel->whatever()

If not, you should probably use ClassRegistry::init(). See this thread:

http://groups.google.com/group/cake-php/browse_thread/thread/137c57b4eb010317?pli=1

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: