public function update($nullValues = false) { if (!$this->deleted && $this->isUsed()) { $historized_tax = new Tax($this->id); $historized_tax->historize(); // remove the id in order to create a new object $this->id = 0; $res = $this->add(); // change tax id in the tax rule table $res &= TaxRule::swapTaxId($historized_tax->id, $this->id); return $res; } elseif (parent::update($nullValues)) { return $this->_onStatusChange(); } return false; }