You are here

function _entityqueue_get_target_field_name in Entityqueue 7

Helper function for getting the name of a entityreference field.

Parameters

string $entity_type: A Drupal entity type.

Return value

string The name of the entityreference field for the given entity type.

11 calls to _entityqueue_get_target_field_name()
entityqueue_export_ui::list_form_submit in plugins/ctools/export_ui/entityqueue_export_ui.class.php
Overrides ctools_export_ui::list_form_submit().
entityqueue_queue_delete in ./entityqueue.module
Deletes a queue.
entityqueue_subqueue_clear_validate in includes/entityqueue.admin.inc
Validation callback to clear items in the subqueue.
entityqueue_subqueue_edit_form in includes/entityqueue.admin.inc
Form callback; Displays the subqueue edit form.
entityqueue_subqueue_edit_form_validate in includes/entityqueue.admin.inc
Validation callback for the subqueue edit form.

... See full list

File

./entityqueue.module, line 756
Allows users to collect entities in arbitrarily ordered lists.

Code

function _entityqueue_get_target_field_name($entity_type) {
  if (drupal_strlen($entity_type) <= 29) {
    return 'eq_' . $entity_type;
  }
  else {

    // Field names cannot be longer than 32 characters, so have to use a hashing
    // trick in order to get a human-readable field name for long entity types.
    return 'eq_' . substr($entity_type, 0, 20) . '_' . substr(md5($entity_type), 0, 8);
  }
}