protected Tables::addJoin($type, $table, $join_condition, $langcode,$delta= NULL)
File
- core/lib/Drupal/Core/Entity/Query/Sql/Tables.php, line 330
Class
- Tables
- Adds tables and fields to the SQL entity query.
Namespace
Drupal\Core\Entity\Query\Sql
Code
protected function addJoin($type, $table, $join_condition, $langcode, $delta = NULL) {
$arguments = array();
if ($langcode) {
$entity_type_id = $this->sqlQuery->getMetaData('entity_type');
$entity_type = $this->entityManager->getDefinition($entity_type_id);
// Only the data table follows the entity language key, dedicated field
// tables have an hard-coded 'langcode' column.
$langcode_key = $entity_type->getDataTable() == $table ? $entity_type->getKey('langcode') : 'langcode';
$placeholder = ':langcode' . $this->sqlQuery->nextPlaceholder();
$join_condition .= ' AND %alias.' . $langcode_key . ' = ' . $placeholder;
$arguments[$placeholder] = $langcode;
}
if (isset($delta)) {
$placeholder = ':delta' . $this->sqlQuery->nextPlaceholder();
$join_condition .= ' AND %alias.delta = ' . $placeholder;
$arguments[$placeholder] = $delta;
}
return $this->sqlQuery->addJoin($type, $table, NULL, $join_condition, $arguments);
}
Please login to continue.