[symfony-users] Re: DbFinder returning too many columns when orderBy non-PK column

2009-05-13 Thread David Ashwood
Try using an alias with the column and then ordering by the alias. The reason for the uppercase version is to allow for a case-insensitive sort. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Phil Moorhouse Sent: 13 May 2009

[symfony-users] Re: DbFinder returning too many columns when orderBy non-PK column

2009-05-13 Thread Phil Moorhouse
Using an alias fixed it, cheers. Interestingly this prevents it returning the extra column. $this-eventTypes = DbFinder::from('EventType') -select(array('EventType.EventTypeId')) -withColumn('EventType.Name', 'eventTypeName') -withColumn('EventTypePerNewsItem.NewsItemId', 'selected')