You are here

function node_gallery_api_original_datetime_chronological_sort in Node Gallery 7

Helper function to sort items by Datetime

Parameters

object $oa: The left term of the sorting-comparison. Must have an original_DateTime member.

object $ob: Idem as $oa, being the right term.

Return value

int Return 0 if the original_DateTime member of each given objects are equal -1 if oa's original_DateTime is smaller +1 else

1 string reference to 'node_gallery_api_original_datetime_chronological_sort'
node_gallery_api_sort_items_form_set_chronological_sorting in ./node_gallery_api.pages.inc
Submit function to set image weights reflecting chronological order of their making

File

./node_gallery_api.inc, line 1041
Node Gallery API function

Code

function node_gallery_api_original_datetime_chronological_sort($oa, $ob) {
  $a = $oa->original_DateTime;
  $b = $ob->original_DateTime;
  if ($a == $b) {
    return 0;
  }
  return $a < $b ? -1 : 1;
}