define var $order = "Item.code"  and var $order = "Batch.code"

On Nov 12, 11:43 am, Ernesto <[email protected]> wrote:
> Hello.
>
> i have 3 models
>
> - Item
> - Batch
> - Person
>
> Item belongsTo Batch
> Item belongsTo Person
>
> both Item and Batch models have
> var $order = "code"
>
> i'm retrieving data from ItemsController using containable
> $this->Item->find("all", array("contain" => array("Batch",
> "Person")));
>
> i'm getting a "SQL Error 1052: Column 'code' in order clause is
> ambiguous"
>
> is that because containable doesn't put aliases after "ORDER BY"
> clause?

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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=.


Reply via email to