src/Traits/ReflectionUtilities.php
public function setProperty($object, $property, $value) {
        $objectReflector = new ReflectionObject($object);

        if(!$objectReflector->hasProperty($property)) {
            throw new Exception('Property cannot be set! This property not exist inside the given object!');
        }

        $propertyReflector = $objectReflector->getProperty($property);
        $propertyReflector->setAccessible(TRUE);
        $propertyReflector->setValue($object, $value);

        return TRUE;
    }
public function setProperty($object, $property, $value) {
        $objectReflector = new ReflectionObject($object);

        if(!$objectReflector->hasProperty($property)) {
            throw new Exception('Property cannot be set! This property not exist inside the given object!');
        }

        $propertyReflector = $objectReflector->getProperty($property);
        $propertyReflector->setAccessible(TRUE);
        $propertyReflector->setValue($object, $value);

        return TRUE;
    }
public function setProperty ( $ object , $ property , $ value ) { $ objectReflector = new ReflectionObject ( $ object ) ; if ( ! $ objectReflector -> hasProperty ( $ property ) ) { throw new Exception ( 'Property cannot be set! This property not exist inside the given object!' ) ; } $ propertyReflector = $ objectReflector -> getProperty ( $ property ) ; $ propertyReflector -> setAccessible ( TRUE ) ; $ propertyReflector -> setValue ( $ object , $ value ) ; return TRUE ; }
Set a property value on the given object. If the property is not found in the given object
an Exception will be thrown.

@param object $object A concrete object
@param string $property The property name
@param mixed $value The property new value

@return bool

@throws \BuildR\Foundation\Exception\Exception
Set a property value on the given object . If the property is not found in the given object an Exception will be thrown .