1 field_sql_storage.module _field_sql_storage_query_join_entity(SelectQuery $select_query, $entity_type, $field_base_table)

Adds the base entity table to a field query object.

Parameters

SelectQuery $select_query: A SelectQuery containing at least one table as specified by _field_sql_storage_tablename().

$entity_type: The entity type for which the base table should be joined.

$field_base_table: Name of a table in $select_query. As only INNER JOINs are used, it does not matter which.

Return value

The name of the entity base table joined in.:

File

core/modules/field/modules/field_sql_storage/field_sql_storage.module, line 608
Default implementation of the field storage API.

Code

function _field_sql_storage_query_join_entity(SelectQuery $select_query, $entity_type, $field_base_table) {
  $entity_info = entity_get_info($entity_type);
  $entity_base_table = $entity_info['base table'];
  $entity_field = $entity_info['entity keys']['id'];
  $select_query->join($entity_base_table, $entity_base_table, "$entity_base_table.$entity_field = $field_base_table.entity_id");
  return $entity_base_table;
}