// if there are no references in exclusions we don't need to update anything
if ((is_countable($promotionExclusions) ? \
count($promotionExclusions) : 0
) === 0
) { continue;
} // check for corrupted data in database. If a excluded promotion could not be found it will not be present in results
$results =
$this->
getExistingIds($promotionExclusions);
if (\
count($results) === (is_countable($promotionExclusions) ? \
count($promotionExclusions) : 0
)) { // if there is no corrupted data we will add id to all excluded promotions too
$this->
addToJSON($id,
$promotionExclusions);
continue;
} // there is corrupted data we have to update data with only valid exclusions
$onlyAddThisExistingIds =
[];
// converting from hex to byte ensures that case sensitivity in hex values doesn't matter
$resultValues =
$this->
convertHexArrayToByteArray($results);
// select valid excluded promotions