private static function checkCustomFieldExists($owningEntity, $key)
    {
        if (is_null(self::getEntityType($owningEntity, $key))) {
            $msg = sprintf('CustomField "%s" does not exist for entity class "%s"', $key, ClassUtils::getClass($owningEntity));
            throw new \LogicException($msg);
        }
    }