$directReads =
[];
$searches =
[];
$criteriaCollection =
$this->
flattenCriteriaCollections($criteriaCollections);
foreach ($criteriaCollection as $definition =>
$criteriaObjects) { $directReads[$definition] =
[[]];
$searches[$definition] =
[];
foreach ($criteriaObjects as $criteria) { if ($this->
canBeMerged($criteria)) { $directReads[$definition][] =
$criteria->
getIds();
} else { $criteriaHash =
$this->
hash($criteria);
$criteria->
addExtension('criteriaHash',
new ArrayEntity(['hash' =>
$criteriaHash]));
$searches[$definition][$criteriaHash] =
$criteria;
} } } foreach ($directReads as $definition =>
$idLists) { /** @var array<string, array<string>> $directReads */