Created
August 11, 2015 05:54
-
-
Save FMCorz/341229234894bdfb7eb4 to your computer and use it in GitHub Desktop.
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
<?php | |
/** | |
* Gets the sort direction for a given field | |
* | |
* @param string $field | |
* @return string ASC or DESC | |
*/ | |
public function get_field_sort_direction($field) { | |
$dir = $this->sortdirection || self::DEFAULTSORTDIRECTION; | |
if ($field == $this->sort) { | |
$dir = ($dir == 'ASC') ? 'DESC' : 'ASC'; | |
} | |
if ($field == 'lastaccess') { | |
$dir = ($dir == 'ASC') ? 'DESC' : 'ASC'; | |
} | |
return self::DEFAULTSORTDIRECTION; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment