Exemplo n.º 1
0
 /**
  * @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;
 }
Exemplo n.º 2
0
 /**
  * Creates a new tax struct and assigns the passed
  * data array.
  *
  * @param array $data
  * @return \Shopware\Bundle\StoreFrontBundle\Struct\Tax
  */
 public function hydrateRule(array $data)
 {
     $tax = new Struct\Tax();
     $tax->setId((int) $data['__taxRule_groupID']);
     $tax->setName($data['__taxRule_name']);
     $tax->setTax((double) $data['__taxRule_tax']);
     return $tax;
 }