You are here

public function CertificateEntityUIController::labelSorter in Certificate 8.3

Same name and namespace in other branches
  1. 7.3 certificate.classes.inc \CertificateEntityUIController::labelSorter()

uasort() callback to sort by label of a table row.

File

./certificate.classes.inc, line 33

Class

CertificateEntityUIController
Custom Entity admin

Code

public function labelSorter($a, $b) {
  if (!isset($b[0]['data']['#label'])) {
    return -1;
  }
  if (!isset($a[0]['data']['#label'])) {
    return 1;
  }
  return strcasecmp($a[0]['data']['#label'], $b[0]['data']['#label']);
}