Thanks for the detailed response, ShadowCross. That's exactly what I
was after. Now I read it, it all makes perfect sense.
T
On Jan 24, 9:38 pm, ShadowCross wrote:
> Assuming
>
> ModelA hasMany ModelB
> ModelB includes a date column called 'date'
>
> you could try:
>
> $this->ModelA->bindModel
Assuming
ModelA hasMany ModelB
ModelB includes a date column called 'date'
you could try:
$this->ModelA->bindModel(array(
'hasOne' => array(
'MaxDateModelB' => array(
'className' => 'ModelB',
'foreign_key => 'model_a_id',
'conditions' => 'MaxDateMo
On Sun, Jan 23, 2011 at 4:56 AM, Toby G wrote:
> Morning all,
>
> I'm a little stumped this morning, on how to sort a model's records
> based on the max value of it's associated (has many) dates. Initially
> I used a find & then a sort, however I now need to paginate the
> results, so I need to b
Morning all,
I'm a little stumped this morning, on how to sort a model's records
based on the max value of it's associated (has many) dates. Initially
I used a find & then a sort, however I now need to paginate the
results, so I need to be able to order the results as part of the
paginated find.