You are here

public function ReportFileSystem::reportCompare in Forena Reports 8

Sort compare function for sorting data by category then title.

Parameters

object $a: Report metatdata

object $b: Report metadata

Return value

number

File

src/File/ReportFileSystem.php, line 105

Class

ReportFileSystem

Namespace

Drupal\forena\File

Code

public function reportCompare($a, $b) {
  $c = strnatcasecmp($a->metaData['category'], $b->metaData['category']);
  if (!$c) {
    $c = strnatcasecmp($a->metaData['title'], $b->metaData['title']);
  }
  return $c;
}