toArray(); } if (isset($options['options'])) { unset($options['options']); } foreach ((array) $options as $key => $value) { $method = 'set' . ucwords($key); if (method_exists($this, $method)) { $this->$method($value); } elseif (in_array($key, $this->properties, true)) { $this->{$key} = $value; } } return $this; } public function __get($name) { if (in_array($name, $this->properties)) { return $this->{$name}; } throw new \Exception('Trying to get unknown property "' . $name . '"'); } function __isset($name) { if (in_array($name, $this->properties)) { return isset($this->{$name}); } return false; } }