Esempio n. 1
0
 /**
  * @return \Generated\Shared\Transfer\WishlistTransfer
  */
 public function getWishlist()
 {
     $wishlist = $this->wishlistQueryContainer->queryWishlist()->findOneByFkCustomer($this->customerTransfer->getIdCustomer());
     $wishlistTransfer = new WishlistTransfer();
     foreach ($wishlist->getSpyWishlistItems() as $wishlistItemEntity) {
         $wishlistItemTransfer = new ItemTransfer();
         $productEntity = $wishlistItemEntity->getSpyProduct();
         $wishlistItemTransfer->setGroupKey($wishlistItemEntity->getGroupKey())->setAddedAt($wishlistItemEntity->getAddedAt())->setIdProductAbstract($wishlistItemEntity->getFkProductAbstract())->setSku($productEntity->getSku())->setQuantity($wishlistItemEntity->getQuantity());
         $wishlistTransfer->addItem($wishlistItemTransfer);
     }
     return $wishlistTransfer;
 }
Esempio n. 2
0
 /**
  * @param int $idCustomer
  *
  * @return \Orm\Zed\Wishlist\Persistence\SpyWishlist
  */
 protected function getWishlistEntity($idCustomer)
 {
     $wishlistEntity = $this->wishlistQueryContainer->queryWishlist()->findOneByFkCustomer($idCustomer);
     return $wishlistEntity;
 }