public function getOrCreateContentBlock($name, $locale = null, $useLocaleFallback = null, $defaultType = null, $defaultValue = null)
    {
        $autoLocale = false;
        if (null === $locale)
        {
            $locale = (null !== $this->translator) ? $this->translator->getLocale() : $this->defaultLocale;
            $autoLocale = true;
        }

        if (null === $useLocaleFallback)
        {
            $useLocaleFallback = $this->isUsingLocaleFallback();
        }

        $block = $this->getContentBlock($name, $locale, $useLocaleFallback);
        if (null !== $block && ($autoLocale || $block->getLocale() == $locale))
        {
            return $block;
        }

        if (null === $defaultType || null === $defaultValue)
        {
            // no default type and value, don't auto-create
            return null;
        }

        // Let's create a new block based on the default values

        // If the locale was determined automatically AND we are in fallback mode, the new block is added for the default locale
        // instead of the current one. This way we won't get different localed blocks with the same default value.
        if ($autoLocale && $useLocaleFallback)
        {
            $locale = (null !== $this->translator) ? reset($this->locales) : $this->defaultLocale;
        }

        return $this->createContentBlock($name, $locale, $defaultType, $defaultValue);
    }