ShopLocaleNotSetException example


    protected function initExtends()
    {
        $extends = [];
        $shop = $this->shop;
        $locale = $this->locale;
        if (!$locale instanceof Locale) {
            throw new ShopLocaleNotSetException();
        }

        $main = $shop !== null ? $shop->getMain() : null;
        if ($main !== null && $main->getId() === 1) {
            $main = null;
        }

        // fallback to parent shop, current locale         if ($main !== null && $main->getId() !== 1) {
            $extends[] = [
                $main->getId(),
                
public function setCategory($category)
    {
        $this->category = $category;
    }

    /** * @return Locale */
    public function getLocale()
    {
        if (!$this->locale instanceof Locale) {
            throw new ShopLocaleNotSetException();
        }

        return $this->locale;
    }

    /** * @param Locale|null $locale */
    public function setLocale($locale)
    {
        $this->locale = $locale;
    }
Home | Imprint | This part of the site doesn't use cookies.