Example #1
0
 public function toArray($iso = null)
 {
     $array = $this->_extraRow->toArray($iso);
     $array['price'] = $this->getPrice();
     $array['value'] = $this->getValue();
     $array['tax'] = $this->getTax();
     return $array;
 }
Example #2
0
 function insertRows(RM_Extras_Row $extra, array $unitIDs)
 {
     $this->delete('extra_id=' . $extra->id);
     //remove old values
     if ($unitIDs[0] == 0) {
         //all units
         $extra->global = 1;
         $extra->save();
         return true;
     } elseif ($extra->global == 1) {
         $extra->global = 0;
         $extra->save();
     }
     foreach ($unitIDs as $unitID) {
         $this->createRow(array('extra_id' => $extra->id, 'unit_id' => $unitID))->save();
     }
 }