virtual field in related model

2009-05-15 Thread Ernesto

hello.

i'm having some troubles :(

i have an Order model hasMany Item model.

Item should have a calculated field (Item.Cost/Item.Weight)

- i modified $queryData in beforeFind callback... but this callback
doesn't seems to work if the model isn't the primary one.

- i modified $results in afterFind callback... but cake has many ways
to load data...

is there any other way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: virtual field in related model

2009-05-15 Thread grigri

Hi Ernesto

This (calculated/dynamic fields) has been brought up several times
here; this is a link to the most relevant thread I can find:

http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f168cd619

Should help you out

hth
grigri

On May 15, 12:47 pm, Ernesto e.fanz...@gmail.com wrote:
 hello.

 i'm having some troubles :(

 i have an Order model hasMany Item model.

 Item should have a calculated field (Item.Cost/Item.Weight)

 - i modified $queryData in beforeFind callback... but this callback
 doesn't seems to work if the model isn't the primary one.

 - i modified $results in afterFind callback... but cake has many ways
 to load data...

 is there any other way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: virtual field in related model

2009-05-15 Thread Ernesto

oh thx i haven't found that post :)

On 15 Mag, 14:59, grigri j...@hendersonwebdesign.com wrote:
 Hi Ernesto

 This (calculated/dynamic fields) has been brought up several times
 here; this is a link to the most relevant thread I can find:

 http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f...

 Should help you out

 hth
 grigri

 On May 15, 12:47 pm, Ernesto e.fanz...@gmail.com wrote:



  hello.

  i'm having some troubles :(

  i have an Order model hasMany Item model.

  Item should have a calculated field (Item.Cost/Item.Weight)

  - i modified $queryData in beforeFind callback... but this callback
  doesn't seems to work if the model isn't the primary one.

  - i modified $results in afterFind callback... but cake has many ways
  to load data...

  is there any other way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---