30 $propSTable = $this->entity->getSingleValueTableName();
31 $commonAlias = mb_substr($propSTable, 2);
37 $replacedAliases = [];
40 foreach ($this->join_map as $k => $join)
43 if ($join[
'table'] === $propSTable && $join[
'type'] === Join::TYPE_INNER)
46 $conditions = $join[
'reference']->getConditions();
49 if (count($conditions) === 1 && $conditions[0]->getColumn() ===
'ID' && $conditions[0]->getOperator() ===
'=')
52 $replacedAliases[$join[
'alias']] =
true;
57 $this->join_map[$k][
'alias'] = $commonAlias;
64 unset($this->join_map[$k]);
72 foreach ($this->global_chains as $chain)
74 if (!empty($replacedAliases[$chain->getLastElement()->getParameter(
'talias')]))
76 $chain->getLastElement()->setParameter(
'talias', $commonAlias);
81 return parent::buildJoin();