getProductImage() public method

Get ProductImage
public getProductImage ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection
Example #1
0
 /**
  * 商品画像の削除、登録
  */
 protected function createProductImage($row, Product $Product)
 {
     if ($row['商品画像'] != '') {
         // 画像の削除
         $ProductImages = $Product->getProductImage();
         foreach ($ProductImages as $ProductImage) {
             $Product->removeProductImage($ProductImage);
             $this->em->remove($ProductImage);
         }
         // 画像の登録
         $images = explode(',', $row['商品画像']);
         $rank = 1;
         foreach ($images as $image) {
             $ProductImage = new ProductImage();
             $ProductImage->setFileName(Str::trimAll($image));
             $ProductImage->setProduct($Product);
             $ProductImage->setRank($rank);
             $Product->addProductImage($ProductImage);
             $rank++;
             $this->em->persist($ProductImage);
         }
     }
 }
 /**
  * {@inheritDoc}
  */
 public function getProductImage()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getProductImage', array());
     return parent::getProductImage();
 }