/** * @param Models\Tax\Tax $tax * @return Struct\Tax */ public function convertTax(Models\Tax\Tax $tax) { $struct = new Struct\Tax(); $struct->setId($tax->getId()); $struct->setTax($tax->getTax()); $struct->setName($tax->getName()); return $struct; }
/** * Creates a simple product which contains all required * data for an quick product creation. * * @param $number * @param Tax $tax * @param Group $customerGroup * @param float $priceOffset * @return array */ public function getSimpleProduct($number, $tax, Group $customerGroup, $priceOffset = 0.0) { if ($customerGroup instanceof Models\Customer\Group) { $struct = new Group(); $struct->setId($customerGroup->getId()); $struct->setKey($customerGroup->getKey()); $struct->setName($customerGroup->getName()); } $data = $this->getProductData(array('taxId' => $tax->getId())); $data['mainDetail'] = $this->getVariantData(array('number' => $number)); $data['mainDetail']['prices'] = $this->getGraduatedPrices($customerGroup->getKey(), $priceOffset); $data['mainDetail'] += $this->getUnitData(); return $data; }
/** * {@inheritDoc} */ public function getId() { if ($this->__isInitialized__ === false) { return (int) parent::getId(); } $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); return parent::getId(); }