Have you seen the example of the Observer pattern, described in the
bakery somewhere?
This might be helpful...

On May 24, 1:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I've searched around but can't find any discusson on this...
>
> I have a method in the model that is handling a certain function for
> me. It adds a couple records all linked together, and also allows
> editing of these records. For the sake of example from the controller
> I call:
>
> $this->PartyParticipant->handleGuest( $name, $email, $rsvp );
>
> and it will do its stuff, interacting with a couple models fine since
> they're all referenced in the PartyParticipant model (via hasOne,
> belongsTo, etc).
>
> Problem is, I want to invalidate fields of OTHER models within this
> method.
>
> In the model I want to write:
> $this->UserDetail->invalidate('name')
>
> However the controller has a unique UserDetail object from the
> PartyParticipant object... so it loses that invalidation data.
>
> I suppose I can do this from controller:
> $this->PartyParticipant->controller = &$this;
>
> and in the PartyParticipant model:
> $this->controller->UserDetail->invalidate('name');
>
> but i hate to rely on a reference needing to be passed..
>
> Any ideas? Thoughts? threats?
>
> Thanks!!
>
> -ryan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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