createElements example

foreach ($data['shops'] as $shop) {
                $subShop = $this->get('models')->find(Shop::class$shop['id']);

                if ($shop !== null) {
                    $shops->add($subShop);
                }
            }
        }

        $elements = [];
        if (!empty($data['elements'])) {
            $elements = $this->createElements($emotion$data['elements']);
        }

        if (Shopware()->Container()->get('auth')->getIdentity()->id) {
            $user = $this->get('models')->find(User::classShopware()->Container()->get('auth')->getIdentity()->id);
            $emotion->setUser($user);
        }

        $emotion->setModified(new DateTime());
        $emotion->setName($data['name']);
        $emotion->setValidFrom($validFrom);
        $emotion->setValidTo($validTo);
        
Home | Imprint | This part of the site doesn't use cookies.