$associationCriteria =
$criteria->
getAssociation($association->
getPropertyName());
if (!
$associationCriteria->
getTitle() &&
$criteria->
getTitle()) { $associationCriteria->
setTitle( $criteria->
getTitle() . '::association::' .
$association->
getPropertyName() );
} // check if the requested criteria is restricted (limit, offset, sorting, filtering)
if ($this->
isAssociationRestricted($criteria,
$association->
getPropertyName())) { // if restricted load paginated list of many to many
$this->
loadManyToManyWithCriteria($associationCriteria,
$association,
$context,
$collection,
$partial);
return;
} // otherwise the association is loaded in the root query of the entity as sub select which contains all ids
// the ids are extracted in the entity hydrator (see: \Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityHydrator::extractManyToManyIds)
$this->
loadManyToManyOverExtension($associationCriteria,
$association,
$context,
$collection,
$partial);
} private function addManyToManySelect( EntityDefinition
$definition,