public function setHumanValue($value) { $this->humanValue = $value; $old = $this->value; $this->value = static::humanToPlain($value); $this->onUpdate($old); }
/** * Constructor * @param hash * @return object */ public function __construct($arr = []) { foreach ($arr as $k => $v) { if (!is_object($v)) { $e = new Generic(); $e->setHumanValue($v); $this->{$k} = $e; } else { $this->{$k} = $v; } } }