[symfony-users] Re: How to get default sort method for models?

2010-01-19 Thread Darren884
Isn't there any other way? Is it truly that tedious to set a default
sort option?

On Jan 19, 2:39 am, Florian sideral.undergro...@gmail.com wrote:
 Hi darren,

 You should read this :

 http://www.doctrine-project.org/blog/cookbook-recipe-relation-dql-beh...

 On 18 jan, 18:30, Darren884 darren...@gmail.com wrote:

  Hello all, my customer model currently defaults to sorting by id asc.
  How do I change it to default to sort by name asc?

  Thanks,
  Darren
-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Re: How to get default sort method for models?

2010-01-19 Thread ashton honnecke
If that's more than you were interested in, you can do this:
$q = Doctrine_Table::Create()-
select('*')-
from('customer as c')-
orderBy('first_name ASC');

$customers = $q-execute();

Throw that into a method in a table class (a solid design practice
anyway), and then you have less code than you would had in the first
place.

On Tue, Jan 19, 2010 at 11:05 AM, Darren884 darren...@gmail.com wrote:
 Isn't there any other way? Is it truly that tedious to set a default
 sort option?

 On Jan 19, 2:39 am, Florian sideral.undergro...@gmail.com wrote:
 Hi darren,

 You should read this :

 http://www.doctrine-project.org/blog/cookbook-recipe-relation-dql-beh...

 On 18 jan, 18:30, Darren884 darren...@gmail.com wrote:

  Hello all, my customer model currently defaults to sorting by id asc.
  How do I change it to default to sort by name asc?

  Thanks,
  Darren

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.





-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.