PHPDaemon\Config\Entry\Generic::setHumanValue PHP Method

setHumanValue() public method

Set human-readable value
public setHumanValue ( $value ) : void
return void
    public function setHumanValue($value)
    {
        $this->humanValue = $value;
        $old = $this->value;
        $this->value = static::humanToPlain($value);
        $this->onUpdate($old);
    }

Usage Example

Example #1
0
 /**
  * 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;
         }
     }
 }
All Usage Examples Of PHPDaemon\Config\Entry\Generic::setHumanValue