protected function setProperty(
        $object, $accessor, $value
    ) {
        if (!$accessor->isPublic() && $this->bIgnoreVisibility) {
            $accessor->setAccessible(true);
        }
        if ($accessor instanceof ReflectionProperty) {
            $accessor->setValue($object, $value);
        } else {
            //setter method
            $accessor->invoke($object, $value);
        }
    }
protected function setProperty(
        $object, $accessor, $value
    ) {
        if (!$accessor->isPublic() && $this->bIgnoreVisibility) {
            $accessor->setAccessible(true);
        }
        if ($accessor instanceof ReflectionProperty) {
            $accessor->setValue($object, $value);
        } else {
            //setter method
            $accessor->invoke($object, $value);
        }
    }
protected function setProperty ( $ object , $ accessor , $ value ) { if ( ! $ accessor -> isPublic ( ) && $ this -> bIgnoreVisibility ) { $ accessor -> setAccessible ( true ) ; } if ( $ accessor instanceof ReflectionProperty ) { $ accessor -> setValue ( $ object , $ value ) ; } else { //setter method $ accessor -> invoke ( $ object , $ value ) ; } }
Set a property on a given object to a given value.

Checks if the setter or the property are public are made before
calling this method.

@param object $object   Object to set property on
@param object $accessor ReflectionMethod or ReflectionProperty
@param mixed  $value    Value of property

@return void
Set a property on a given object to a given value .