Exemplo n.º 1
0
 /**
  * @param \Orm\Zed\Product\Persistence\SpyProduct $product
  *
  * @return array
  */
 protected function getProductPriceList(SpyProduct $product)
 {
     $productPricesCollection = $product->getPriceProductsJoinPriceType();
     // @todo this is here for proof of concept, will be changed
     $whiteListPrices = [1, 5, 10, 20, 50, 100];
     $priceList = [];
     foreach ($productPricesCollection as $priceDefinition) {
         if (!in_array($priceDefinition->getPriceType()->getName(), $whiteListPrices)) {
             continue;
         }
         $priceList[] = ['name' => $priceDefinition->getPriceType()->getName(), 'value' => $priceDefinition->getPrice()];
     }
     return $priceList;
 }