You are here

private function GatherContentCurl::sortPages in GatherContent 7.2

Sort pages by position and id.

File

includes/curl.inc, line 810
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

private function sortPages($a, $b) {
  if ($a->position == $b->position) {
    if ($a->id == $b->id) {
      return 0;
    }
    else {
      return $a->id < $b->id ? -1 : 1;
    }
  }
  return $a->position < $b->position ? -1 : 1;
}