Hello, quote from
http://manual.cakephp.org/chapter/models
"afterFind
Use this callback to modify results that have been returned from a
find operation, or perform any other post-find logic. The parameter
for this function is the returned results from the model's find
operation, and the return value is the modified results."
2007/5/31, laptop <[EMAIL PROTECTED]>:
>
> Hi,
>
> Is there a way to add a field to a model which is the result of an SQL
> function. My scenario is that I have an image_url field, the thumb of
> the image_url is also stored in the same directory with '_thumb'
> appended before the index.
>
> ie bradcraig.jpg would become bradcraig_thumb.jpg
>
> Is there a way I can include a SQL function when retrieving the
> model?? The SQL to calculate it is below..
>
> SELECT 'images/bradcraig.jpg' AS image_url,
> CONCAT(SUBSTRING_INDEX('images/bradcraig.jpg', '.', 1), '_thumb.',
> SUBSTRING_INDEX('images/bradcraig.jpg', '.', -1)) AS thumb_url;
>
> Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---