if (\
count($criteria->
getSorting())) { return true;
} // queries can only be handled in entity searcher
if (\
count($criteria->
getQueries())) { return true;
} $filters =
array_merge( $criteria->
getFilters(),
$criteria->
getPostFilters() );
/** @var CriteriaPartInterface $filter */
foreach ($filters as $filter) { $accessors =
$filter->
getFields();
foreach ($accessors as $accessor) { // get all fields of accessor to check which fields will be joined
$definitionFields = EntityDefinitionQueryHelper::
getFieldsOfAccessor($definition,
$accessor);
// if the criteria contains an access to a OneToMany or ManyToMany field, the query would run into a temporary table.
// to prevent overload for sql servers we will execute a minimal query with the ids at first