function _field_test_field_storage_query_sort_helper
7.x 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.
1 string reference to '_field_test_field_storage_query_sort_helper'
- field_test_field_storage_query in drupal-7.x/
modules/ field/ tests/ field_test.storage.inc - Implements hook_field_storage_query().
File
- drupal-7.x/
modules/ field/ tests/ field_test.storage.inc, line 353 - 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;
}
}