Exemplo n.º 1
0
 /**
  * Returns the column/value data as an array and parse all assigned units
  * in csv format in 'units' field.
  *
  * @return array
  */
 public function toArray()
 {
     $dataRow = parent::toArray();
     if ($this->global == 1) {
         $dataRow['units'] = array(0);
     } else {
         $unitTaxesModel = new RM_UnitTaxes();
         $unitIDs = array();
         $unitTaxes = $unitTaxesModel->getByTax($this);
         foreach ($unitTaxes as $unitTax) {
             $unitIDs[] = $unitTax->unit_id;
         }
         $dataRow['units'] = implode(',', $unitIDs);
     }
     return $dataRow;
 }
Exemplo n.º 2
0
 /**
  * Returns the column/value data as an array and parse all assigned units
  * in csv format in 'units' field.
  *
  * @return array
  */
 public function toArray($iso = null)
 {
     $dataRow = parent::toArray();
     if ($this->global == 1) {
         $dataRow['units'] = array(0);
     } else {
         $unitExtrasModel = new RM_UnitExtras();
         $unitIDs = array();
         $unitExtras = $unitExtrasModel->getByExtra($this);
         foreach ($unitExtras as $unitExtra) {
             $unitIDs[] = $unitExtra->unit_id;
         }
         $dataRow['units'] = implode(',', $unitIDs);
     }
     $dataRow['name'] = $this->getName($iso);
     return $dataRow;
 }
Exemplo n.º 3
0
 /**
  * Returns the column/value data as an array and parse all assigned units
  * in csv format in 'units' field.
  *
  * @return array
  */
 public function toArray()
 {
     return parent::toArray();
 }