$definition =
$cur['definition'
];
$criteria =
$cur['criteria'
];
if (isset($processed[$definition::
class])) { continue;
} if ($definition instanceof SalesChannelDefinitionInterface
) { $definition->
processCriteria($criteria,
$salesChannelContext);
$eventName = \
sprintf('sales_channel.%s.process.criteria',
$definition->
getEntityName());
$event =
new SalesChannelProcessCriteriaEvent($criteria,
$salesChannelContext);
$this->eventDispatcher->
dispatch($event,
$eventName);
} $processed[$definition::
class] = true;
foreach ($criteria->
getAssociations() as $associationName =>
$associationCriteria) { // find definition
$field =
$definition->
getField($associationName);
if (!
$field instanceof AssociationField
) { continue;
}