afternoon all,
a very simple one. all i would like to do is make sure certain fields
are being included in any read / find / findAll. Could someone have a
look at the code and see where my problem might lie?
function beforeFind(&$queryData)
{
if (!empty($queryData['fields']))
{
foreach ($this->fieldsRequired as $required_field)
{
if (!in_array($required_field,$queryData['fields']))
{
$queryData['fields'][] = $required_field;
}
}
}
return true;
}
Where $this->fieldsRequired is :
var $fieldsRequired = array(
'file_location_live',
'file_location_temp',
'file_location_backup'
);
Thanks fellas, much appreciated.
mikee
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---