/** * Provides write access to ExtensibleObject's properties. * @param string $name * @param mixed $value */ public function __set($name, $value) { if ($this->objectReflection->hasProperty($name) && ($property = $this->objectReflection->getProperty($name)) && $property->isProtected()) { $property->setAccessible(TRUE); $property->setValue($this->object, $value); } else { $this->object->{$name} = $value; } }