Example #1
0
 /**
  * Accepts relevant request parameters from a {@link \Plenigo\models\Product} instance.
  *
  * @param AbstractProduct $product The product instance to extract values from.
  *
  * @return void
  */
 public function setProduct(AbstractProduct $product)
 {
     $productMap = $product->getMap();
     $map = array();
     ArrayUtils::addIfDefined($map, 'productId', $productMap, 'id');
     ArrayUtils::addIfDefined($map, 'price', $productMap, 'price');
     ArrayUtils::addIfDefined($map, 'title', $productMap, 'title');
     ArrayUtils::addIfDefined($map, 'categoryId', $productMap, 'categoryId');
     ArrayUtils::addIfDefined($map, 'currency', $productMap, 'currency');
     ArrayUtils::addIfDefined($map, 'type', $productMap, 'type');
     ArrayUtils::addIfDefined($map, 'subscriptionRenewal', $productMap, 'subscriptionRenewal');
     $this->setValuesFromMap($map);
 }