Skip to content

Instantly share code, notes, and snippets.

@mpmont
Created April 24, 2012 15:46
Show Gist options
  • Save mpmont/2480882 to your computer and use it in GitHub Desktop.
Save mpmont/2480882 to your computer and use it in GitHub Desktop.
Jamie My Model
//Now
/**
* Orders the result set by the criteria,
* using the same format as CI's AR library.
*
* @param mixed $criteria The criteria to order by
* @return void
* @since 1.1.2
*/
public function order_by($criteria, $order = 'ASC')
{
if ( is_array($criteria) )
{
foreach ($criteria as $key => $value)
{
$this->db->order_by($key, $value);
}
}
else
{
$this->db->order_by($criteria, $order);
}
return $this;
}
//Now
/**
* Orders the result set by the criteria,
* using the same format as CI's AR library.
*
* @param string $criteria The criteria to order by
* @return void
* @since 1.1.2
*/
public function order_by($criteria, $order = 'ASC')
{
$this->db->order_by($criteria, $order);
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment