1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103:
<?php
namespace Apptus\ESales\Connector\Report;
/**
* Sub class for {@see ProductTopSellersReport} Contains sales data for one product (or variant).
*/
class ProductTopSellersReportSection {
private $rank;
private $productKey;
private $variantKey;
private $discount; // Calculated as List price - Net selling price
private $purchasedUnits; //The number of purchased units.
private $abandonedUnits;
private $revenue; //Aggregated net selling price
private $margin; //(Gross Profit) Margin - Calculated as Net selling price - Cost as per http://en.wikipedia.org/wiki/Gross_profit_margin
/**
*
* @param int
* The rank of this product (or variant).
* @param string
* The product key of this product.
* @param string
* The variant key if this is a variant, otherwise null.
* @param double
* The total discount for this product (or variant).
* @param int
* The total number of purchased units of this product (or variant).
* @param int
* The total number of abandoned units of this product (or variant).
* @param float
* The total revenue for this product (or variant).
* @param float
* The total margin for this product (or variant).
*/
public function __construct($rank, $productKey, $variantKey, $discount, $purchasedUnits, $abandonedUnits, $revenue, $margin) {
$this->rank = $rank;
$this->productKey = $productKey;
$this->variantKey = $variantKey;
$this->discount = $discount;
$this->purchasedUnits = $purchasedUnits;
$this->abandonedUnits = $abandonedUnits;
$this->revenue = $revenue;
$this->margin = $margin;
}
/**
* @return int The rank of this product (or variant).
*/
public function rank() {
return $this->rank;
}
/**
* @return string The product_key of this product.
*/
public function productKey() {
return $this->productKey;
}
/**
* @return string|null The variant_key if this is a variant, otherwise null.
*/
public function variantKey() {
return $this->variantKey;
}
/**
* @return float The total discount for this product (or variant).
*/
public function discount() {
return $this->discount;
}
/**
* @return int The total number of purchased units of this product (or variant).
*/
public function purchasedUnits() {
return $this->purchasedUnits;
}
/**
* @return int The total number of abandoned units of this product (or variant).
*/
public function abandonedUnits() {
return $this->abandonedUnits;
}
/**
* @return float The total revenue for this product (or variant).
*/
public function revenue() {
return $this->revenue;
}
/**
* @return float The total margin for this product (or variant).
*/
public function margin() {
return $this->margin;
}
}