Example #1
0
 /**
  * Comparator function to sort files by date
  *
  * @param \OCP\Files\FileInfo $a file
  * @param \OCP\Files\FileInfo $b file
  * @return int -1 if $a must come before $b, 1 otherwise
  */
 public static function compareTimestamp(FileInfo $a, FileInfo $b)
 {
     $aTime = $a->getMTime();
     $bTime = $b->getMTime();
     return $aTime < $bTime ? -1 : 1;
 }
Example #2
0
 /**
  * Comparator function to sort files by date
  *
  * @param \OCP\Files\FileInfo $a file
  * @param \OCP\Files\FileInfo $b file
  * @return int -1 if $a must come before $b, 1 otherwise
  */
 public static function compareTimestamp($a, $b)
 {
     $aTime = $a->getMTime();
     $bTime = $b->getMTime();
     return $aTime - $bTime;
 }