mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
Make all descendents of BaseObject compatible with var_export()
This commit is contained in:
parent
e527269633
commit
67047c0939
1 changed files with 16 additions and 0 deletions
|
|
@ -46,6 +46,22 @@ class BaseObject
|
||||||
$this->setMessage($message);
|
$this->setMessage($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set state for var_export()
|
||||||
|
*
|
||||||
|
* @param array $vars
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
public static function __set_state(array $vars)
|
||||||
|
{
|
||||||
|
$instance = new static;
|
||||||
|
foreach ($vars as $key => $val)
|
||||||
|
{
|
||||||
|
$instance->{$key} = $val;
|
||||||
|
}
|
||||||
|
return $instance;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter to set error code or message
|
* Setter to set error code or message
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue