I thought about passing a var from the controller, but I'm not sure
how to do that on a row by row basis. The reason I'm doing this is
probably due to an error in my database logic. I have the following:

'condition' hasAndBelongsToMany 'remedy'
'remedy' belongsToMany 'condition'
'remedy' hasMany 'rating'
'rating' belongsToMany 'remedy'

I have an afterFind in my remedy model that calculates the overall
rating and puts the value into a calculated field. I run into a
problem if a condition does not yet have a remedy, because the
afterFind adds the calculated field and basically creates a blank row
with the one field in it. So, I'm trying to figure out how to avoid
this.


On May 6, 4:32 am, hepper <[EMAIL PROTECTED]> wrote:
> Why not
>
> if (isset($var)) {
>     // Do something with $var
>
> }
>
> On 6 Maj, 06:39, Stacey <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I'm having a problem trying to access 'hasField' in a view. I have a
> > calculated field that is only created if there is a value to put in
> > the field. So, I need to first check if the field is available before
> > I do something with it in my view. Is this possible?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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