コード例 #1
0
 /**
  * @param $number
  * @param \Shopware\Models\Category\Category $category
  * @param Supplier $manufacturer
  * @param ProductContext $context
  * @return array
  */
 protected function getProduct($number, ProductContext $context, Category $category = null, Supplier $manufacturer = null)
 {
     $product = parent::getProduct($number, $context, $category);
     if ($manufacturer) {
         $product['supplierId'] = $manufacturer->getId();
     }
     return $product;
 }
コード例 #2
0
ファイル: Helper.php プロジェクト: GerDner/luck-docker
 /**
  * @param array $data
  * @return Models\Article\Supplier
  */
 public function createManufacturer(array $data = array())
 {
     $data = array_merge($this->getManufacturerData(), $data);
     $manufacturer = new Models\Article\Supplier();
     $manufacturer->fromArray($data);
     $this->entityManager->persist($manufacturer);
     $this->entityManager->flush();
     $this->createdManufacturers[] = $manufacturer->getId();
     return $manufacturer;
 }
コード例 #3
0
 /**
  * {@inheritDoc}
  */
 public function setManyToOne($data, $model, $property)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setManyToOne', array($data, $model, $property));
     return parent::setManyToOne($data, $model, $property);
 }