lithium\core\Object::__set_state PHP Метод

__set_state() публичный статический Метод

PHP magic method used in conjunction with var_export() to allow objects to be re-instantiated with their pre-existing properties and values intact. This method can be called statically on any class that extends Object to return an instance of it.
public static __set_state ( array $data ) : object
$data array An array of properties and values with which to re-instantiate the object. These properties can be both public and protected.
Результат object Returns an instance of the requested object with the given properties set.
    public static function __set_state($data)
    {
        $class = get_called_class();
        $object = new $class();
        foreach ($data as $property => $value) {
            $object->{$property} = $value;
        }
        return $object;
    }