コード例 #1
0
ファイル: Converter.php プロジェクト: GerDner/luck-docker
 /**
  * @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;
 }
コード例 #2
0
ファイル: Helper.php プロジェクト: GerDner/luck-docker
 /**
  * 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;
 }
コード例 #3
0
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }