/** * {@inheritDoc} */ public function getCustomerGroups() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCustomerGroups', array()); return parent::getCustomerGroups(); }
/** * @param array $data * @param \Shopware\Models\Article\Article $article * @throws \Shopware\Components\Api\Exception\CustomValidationException * @return array */ protected function prepareAvoidCustomerGroups($data, ArticleModel $article) { if (!isset($data['customerGroups'])) { return $data; } $customerGroups = $this->checkDataReplacement($article->getCustomerGroups(), $data, 'customerGroups', true); foreach ($data['customerGroups'] as $customerGroupData) { $this->getManyToManySubElement($customerGroups, $customerGroupData, '\\Shopware\\Models\\Customer\\Group'); } $data['customerGroups'] = $customerGroups; return $data; }