Re: Proper Association

2012-10-05 Thread lowpass
It's not clear what it is you're asking. You could use limit and order
constraints to get the last FollowUp for each Item.

On Tue, Oct 2, 2012 at 7:16 PM, strykstaguy  wrote:
> I'm having a hard time how I should approach this but let me explain. I have
> some reports for customers that are uploaded every day such as regarding
> status (i.e. usage). Sometimes these reports are very large and I cannot
> contact all in one day.
>
> Reports
> id | date | created
>
> Then each item in the Report sorted through and then saved to the "Items"
> database.
>
> Items
> id | report_id | name | bid | usage | created
>
> Followups
> id | item_id | note | bid | created
>
> What I need is when I pull the report and display the Items in a table for
> any given Report to display if the customer has been contacted within the
> last month. I can't do hasAndBelongsToMany relationship because with each
> report/day brings new items where the data has changed (i.e. id and usage)
> but the only thing remaining the same is the BID. Would I need to "Join"
> tables?  Any Assistance would be appreciated.
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Proper Association

2012-10-02 Thread strykstaguy
I'm having a hard time how I should approach this but let me explain. I 
have some reports for customers that are uploaded every day such as 
regarding status (i.e. usage). Sometimes these reports are very large and I 
cannot contact all in one day. 

*Reports*
id | date | created

Then each item in the Report sorted through and then saved to the "Items" 
database.

*Items*
id | report_id | name | bid | usage | created

*Followups*
id | item_id | note | bid | created

What I need is when I pull the report and display the Items in a table for 
any given Report to display if the customer has been contacted within the 
last month. I can't do hasAndBelongsToMany relationship because with each 
report/day brings new items where the data has changed (i.e. id and usage) 
but the only thing remaining the same is the BID. Would I need to "Join" 
tables?  Any Assistance would be appreciated.

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.