/** * 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; }
/** * 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; }
/** * 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(); }