/** * @internal * * @param $name * @param $value * @return Result|void * @throws Main\ArgumentOutOfRangeException */ public function initField($name, $value) { if ($this->isCalculatedField($name)) { $this->calculatedFields->set($name, $value); return new Result(); } parent::initField($name, $value); }
/** * @param string $name Field name. * @return mixed|null */ public function getField($name) { if ($this->isCalculatedField($name)) { if (isset($this->calculatedFields[$name]) || array_key_exists($name, $this->calculatedFields)) { return $this->calculatedFields->get($name); } return null; } return parent::getField($name); }
/** * @return bool */ public function isChanged() { return ($changed = $this->fields->getChangedValues()) && !empty($changed); }
/** * @param array $values */ public function setFields(array $values) { $this->fields->resetValues($values); }