public function saveHistory($values = NULL, $forceNew = false, $comment = '') { if (__Config::get('glizy.dataAccess.validate')) { $this->validate($values); } if (!is_null($values)) { parent::loadFromArray($values); } if ($this->isNew() || $forceNew) { $result = $this->insert($values, self::STATUS_DRAFT, $comment); } else { if (!empty($this->modifiedFields) || !is_null($values)) { $result = $this->insertDetailOnly($values, $this->getStatus(), self::STATUS_DRAFT, $comment); } } return $this->getId(); }