src/UnitOfWork.php
private static function getEntityId(
        $stringOrEntity,
        string $idSerializedKey
    ) {
        if (!is_array($stringOrEntity)) {
            return $stringOrEntity;
        }

        return $stringOrEntity[$idSerializedKey] ?? null;
    }
private static function getEntityId(
        $stringOrEntity,
        string $idSerializedKey
    ) {
        if (!is_array($stringOrEntity)) {
            return $stringOrEntity;
        }

        return $stringOrEntity[$idSerializedKey] ?? null;
    }
get entity id from string or array

@param string|array $stringOrEntity
@param string $idSerializedKey

@return ?mixed