/**
  * {@inheritDoc}
  */
 public function getAttribute()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAttribute', array());
     return parent::getAttribute();
 }
示例#2
0
    /**
     * @param array $variantData
     * @param \Shopware\Models\Article\Article $article
     * @param \Shopware\Models\Article\Detail $variant
     * @throws \Shopware\Components\Api\Exception\CustomValidationException
     * @return array
     */
    protected function prepareVariantAttributeAssociatedData($variantData, ArticleModel $article, \Shopware\Models\Article\Detail $variant)
    {
        if (!$variant->getAttribute()) {
            $variantData['attribute']['article'] = $article;
        }

        if (!isset($variantData['attribute'])) {
            return $variantData;
        }

        $variantData['attribute']['article'] = $article;
        return $variantData;
    }
示例#3
0
 /**
  * @param $data
  * @param ArticleModel $article
  * @param Detail $variant
  * @return mixed
  */
 protected function prepareAttributeAssociation($data, ArticleModel $article, Detail $variant)
 {
     if (!$variant->getAttribute()) {
         $data['attribute']['article'] = $article;
     }
     if (!isset($data['attribute'])) {
         return $data;
     }
     $data['attribute']['article'] = $article;
     return $data;
 }