function _field_test_field_storage_query_sort_helper

Sort helper for field_test_field_storage_query().

Sorts by entity type and entity id.

File

modules/field/tests/field_test.storage.inc, line 248

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.