You are here

function _field_test_field_storage_query_sort_helper in SimpleTest 7

Sort helper for field_test_field_storage_query().

Sort by object type and object id.

1 string reference to '_field_test_field_storage_query_sort_helper'
field_test_field_storage_query in tests/field_test.module
Implement hook_field_storage_query().

File

tests/field_test.module, line 1031

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;
  }
}