1 field_test.storage.inc _field_test_field_storage_query_sort_helper($a, $b)

Sort helper for field_test_field_storage_query().

Sorts by entity type and entity id.

File

core/modules/field/tests/field_test/field_test.storage.inc, line 350
Defines a field storage backend.

Code

function _field_test_field_storage_query_sort_helper($a, $b) {
  if ($a->type == $b->type) {
    if ($a->entity_id == $b->entity_id) {
      return 0;
    }
    else {
      return $a->entity_id < $b->entity_id ? -1 : 1;
    }
  }
  else {
    return $a->type < $b->type ? -1 : 1;
  }
}