[EMAIL PROTECTED] wrote:
> hi!
>
> does anyone know, how i can set the order or sort a one-to-many
> relation?
>
> example:
> schema.yml
> Client:
> tableName: client
> columns:
> name:
> type: string
> size: 1000
> description:
> type: string
> size: 1000
> Computer:
> tableName: computer
> columns:
> name:
> type: string
> size: 1000
> client_id:
> foreignClass: Client
> foreignName: Client
> cascadeDelete: true
>
>
> now, after adding some "Computers" to "Client" ... how can i order the
> one-to-many "Computers"?
>
> when i access one client like this...
> $data = sfDoctrine::getTable('Client')->find(1);
$data = Doctrine_Query::create()->from('Client c')->leftJoin('c.Computer
cm')->where('c.id = ?')->orderby('cm.name')->execute(array(1));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---