Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread Dardo Sordi Bogado

I wolud go with making a behavior, and enabling/disabling it, but if a
simple variable fits your needs the go for it.

On Thu, Apr 17, 2008 at 7:41 AM, avairet <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  Some solutions...
>
>  - test a special field (or value) into $results in afterFind(), a
>  field (or value) that is only fetch by your special action's find()
>  - create a custom find() method in your model and call it from your
>  controller's special action (for example: $this->MyModel-
>  >customFind(); )
>  - use Model::query() instead of find() to avoid all model's automagic
>  callbacks
>  - set a special Model's variable in your Controller like you say
>
>  - maybe a Behavior with an empty afterFind() method and a call to the
>  Behavior::find() instead of the Model::find() ? I'm not a master of
>  Behavior usage...
>
>  Hope this answer is understandable and helps you...
>
>  BR
>
>
>
>
>  On 17 avr, 09:19, orbdex <[EMAIL PROTECTED]> wrote:
>  > again: forgot the version: cake 1.2 latest beta
>  >
>

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



Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread avairet

Hello,

Some solutions...

- test a special field (or value) into $results in afterFind(), a
field (or value) that is only fetch by your special action's find()
- create a custom find() method in your model and call it from your
controller's special action (for example: $this->MyModel-
>customFind(); )
- use Model::query() instead of find() to avoid all model's automagic
callbacks
- set a special Model's variable in your Controller like you say

- maybe a Behavior with an empty afterFind() method and a call to the
Behavior::find() instead of the Model::find() ? I'm not a master of
Behavior usage...

Hope this answer is understandable and helps you...

BR


On 17 avr, 09:19, orbdex <[EMAIL PROTECTED]> wrote:
> again: forgot the version: cake 1.2 latest beta
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread orbdex

again: forgot the version: cake 1.2 latest beta
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread orbdex

Hey there,

we're using the afterFind()-Method in one of our models. Works fine.
But there is one admin action where we do not want to call this
method. Which would be the best practise to do that? Setting a
variable of the model within the controller's action?

Thanx for all replies
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---