'order' => array('Tag.created' => 'ASC', 'TAG.id' => 'ASC')
But using 'created' should be sufficient as the id column *usually*
remains the same.
On Thu, Sep 17, 2009 at 8:46 AM, Dave <[email protected]> wrote:
>
> A standard baked model may have something that looks like this:
>
> 'Tag' => array(
> 'className' => 'Tag',
> 'foreignKey' => 'user_id',
> 'dependent' => false,
> 'conditions' => '',
> 'fields' => '',
> 'order' => '',
> 'limit' => '',
> 'offset' => '',
> 'exclusive' => '',
> 'finderQuery' => '',
> 'counterQuery' => ''
> ),
>
> If I set' order' => 'name ASC', for example when I pull the Tag info
> its ordered ASC...OK good.
>
> But when I have a custom function where I need to order by ID or
> created, which takes precident? I tried adding a normal find('all',
> array()); custom function just to test it out where i pull all Tag
> data and order it by created but it still comes out sorted by name
> ASC. It seemed like it would be a good idea to set the order and
> fields and common elements directly to the model code block there,
> rather than having to define order, fields and so on over and over
> with different functions. Is this how it should be done? How do other
> people set it up? Am I missing the idea here?
>
> Dave
> >
>
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---