continue;
} $existingCriteria =
$optimizedCriteriaList[$criteriaPosition]['criteria'
];
// search requests already exists, increase limit to select more products and satisfy all requests
$existingCriteria->
limit($existingCriteria->
getLimit() +
$originalCriteria->
getLimit());
$optimizedCriteriaList[$criteriaPosition]['requests'
][] =
['criteria' =>
$originalCriteria, 'key' =>
$key];
continue;
} $criteria =
$this->
getComparableCriteria($originalCriteria);
$criteria->
limit($originalCriteria->
getLimit());
$optimizedCriteriaList[] =
[ 'criteria' =>
$criteria,
'requests' =>
[ ['criteria' =>
$originalCriteria, 'key' =>
$key],
],
];
} return array_values($optimizedCriteriaList);
}