Welcome Guest, Not a member yet? Register   Sign In
CI + DataMapper + sort relationships
#2

[eluser]BrianDHall[/eluser]
Datamapper is built in top of ActiveRecord, so you can do:

Code:
$a = new A();

$a->where('id', 1)->b->order_by('post', 'ASC")->get();

In Overzealous Extension check the _template.php file in your models directory. For each model you can use a default sort order:

Code:
// --------------------------------------------------------------------
    // Default Ordering
    //   Uncomment this to always sort by 'name', then by
    //   id descending (unless overridden)
    // --------------------------------------------------------------------
    
    // var $default_order_by = array('name', 'id' => 'desc');
    
    // --------------------------------------------------------------------

I think that should handle what you are looking for.


Messages In This Thread
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 08:13 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 08:53 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 10:09 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 10:20 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 10:31 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 11:12 AM
CI + DataMapper + sort relationships - by El Forum - 11-05-2009, 04:42 PM
CI + DataMapper + sort relationships - by El Forum - 11-09-2009, 06:32 PM
CI + DataMapper + sort relationships - by El Forum - 11-09-2009, 07:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB