public function compareEntitiesWithData(
        $entities,
        array $requestEntities,
        callable $compare,
        callable $add = null,
        callable $update = null,
        callable $delete = null
    ) {
        // define a matching function
        $matchFunction = function($entity, $requestEntities, &$matchedEntry, &$matchedKey) use ($compare) {
            $this->findMatchByCallback($entity, $requestEntities, $compare, $matchedEntry, $matchedKey);
        };

        return $this->compareData($entities, $requestEntities, $matchFunction, $add, $update, $delete);
    }