コード例 #1
0
ファイル: PhpFastCache.php プロジェクト: jigoshop/Jigoshop2
 /**
  * @param Product $product Product to find attachments for.
  * @param string $size Size for images.
  * @return array List of attachments attached to the product.
  */
 public function getAttachments(Product $product, $size = Options::IMAGE_THUMBNAIL)
 {
     if (!isset($this->attachments[$product->getId()])) {
         $this->attachments[$product->getId()] = $this->service->getAttachments($product, $size);
     }
     return $this->attachments[$product->getId()];
 }
コード例 #2
0
ファイル: Product.php プロジェクト: jigoshop/Jigoshop2
 public function getAttachments()
 {
     $post = $this->wp->getGlobalPost();
     /** @var \Jigoshop\Entity\Product $product */
     $product = $this->productService->findForPost($post);
     return $this->productService->getAttachments($product);
 }
コード例 #3
0
ファイル: Product.php プロジェクト: jigoshop/Jigoshop2
 /**
  * @param $currentTab string Current tab name.
  * @param $product    \Jigoshop\Entity\Product Shown product.
  */
 public function productDownloads($currentTab, $product)
 {
     Render::output('shop/product/downloads', array('product' => $product, 'currentTab' => $currentTab, 'attachments' => $this->productService->getAttachments($product)['downloads']));
 }