private function getManager(string $resourceClass, $data): ?ObjectManager
    {
        $objectManager = $this->managerRegistry->getManagerForClass($resourceClass);
        if (null === $objectManager || !\is_object($data)) {
            return null;
        }

        return $objectManager;
    }