function save($df) { //the currency field $this->default = unformat_number($this->default); $this->default_value = $this->default; parent::save($df); //currency id $currency_id = new TemplateCurrencyId(); $currency_id->name = 'currency_id'; $currency_id->vname = 'LBL_CURRENCY'; $currency_id->label = $currency_id->vname; $currency_id->save($df); //$df->addLabel($currency_id->vname); }
public function save($df) { //the currency field $this->default = unformat_number($this->default); $this->default_value = $this->default; $this->related_fields = array('currency_id', 'base_rate'); parent::save($df); $df->addLabel('LBL_CURRENCY'); //currency id $currency_id = new TemplateCurrencyId(); $currency_id->name = 'currency_id'; $currency_id->save($df); //base_rate $base_rate = new TemplateCurrencyBaseRate(); $base_rate->name = 'base_rate'; $base_rate->label = 'LBL_CURRENCY_RATE'; $base_rate->save($df); }
function save($df) { $next = false; if (!empty($this->auto_increment) && (!empty($this->autoinc_next) || !empty($this->autoinc_start)) && isset($this->module)) { if (!empty($this->autoinc_start) && $this->autoinc_start > $this->autoinc_next) { $this->autoinc_next = $this->autoinc_start; } if (isset($this->module->table_name)) { global $db; $helper = $db->gethelper(); //Check that the new value is greater than the old value $oldNext = $helper->getAutoIncrement($this->module->table_name, $this->name); if ($this->autoinc_next > $oldNext) { $helper->setAutoIncrementStart($this->module->table_name, $this->name, $this->autoinc_next); } } $next = $this->autoinc_next; $this->autoinc_next = false; } parent::save($df); if ($next) { $this->autoinc_next = $next; } }
function save($df) { parent::save($df); }