add option to sort users and Characters by registration date

This commit is contained in:
coderkun 2014-05-01 14:29:34 +02:00
commit 39c1c06e5b
7 changed files with 88 additions and 32 deletions

View file

@ -716,6 +716,24 @@
}
/**
* Compare two Characters by their registration date.
*
* @param array $a Character a
* @param array $b Character b
* @return int Result of comparison
*/
private function sortCharactersByDate($a, $b)
{
if($a['created'] == $b['created']) {
return 0;
}
return ($a['created'] > $b['created']) ? -1 : 1;
}
/**
* Compare two Characters by one of their Seminary fields.
*

View file

@ -568,8 +568,8 @@
/**
* Compare two users by their userroles.
*
* @param array $a Character a
* @param array $b Character b
* @param array $a User a
* @param array $b User b
* @return int Result of comparison
*/
private function sortUsersByRole($a, $b)
@ -616,6 +616,24 @@
return 1;
}
/**
* Compare two users by their registration date.
*
* @param array $a User a
* @param array $b User b
* @return int Result of comparison
*/
private function sortUsersByDate($a, $b)
{
if($a['created'] == $b['created']) {
return 0;
}
return ($a['created'] > $b['created']) ? -1 : 1;
}
}
?>