Created
April 24, 2012 15:46
-
-
Save mpmont/2480882 to your computer and use it in GitHub Desktop.
Jamie My Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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