Sets a property of an object

@param object $object The object
@param \ReflectionProperty $property The Property
@param mixed $value The new value
963374
protected function setPropertyValue($object, \ReflectionProperty $property, $value)
    {
        if ($value !== null) {
            // If the property is public accessible, set the value directly
            if ($property->isPublic()) {
                $object->{$property->name} = $value;
            } else {
                // If not, use the setter / adder
                $ucw = ucwords($property->name);
                if ($property->getDeclaringClass()->hasMethod($method = 'set' . $ucw)) {
                    $object->$method($value);
                } elseif ($property->getDeclaringClass()->hasMethod($method = 'add' . $ucw)) {
                    $object->$method($value);
                }
            }
        }
    }
1212765
protected function setObjectProperty($object, $name, $value)
    {
        if (ClassInfo::hasMethod($object, 'set' . $name)) {
            $object->{'set' . $name}($value);
        } else {
            $object->$name = $value;
        }
    }
454573
private function setValue($object, \ReflectionProperty $property, $value)
    {
        if ($property->isPublic()) {
            $property->setValue($object, $value);
        } else {
            // Try to use mutator if property is not public
            $mutatorName = $this->formatter->getPhpMutator($property->getName(), false);
            $reflectedObject = new \ReflectionObject($object);
            $reflectedMethod = $reflectedObject->getMethod($mutatorName);

            if (null !== $reflectedMethod) {
                $reflectedMethod->invoke($object, $value);
            }
        }
    }
290636
public static void setProperty(Object obj, String propertyName, final Object value) {
		Method method = getSetterMethod(obj.getClass(), propertyName, value.getClass());
		if (method != null) {
			invokeMethod(obj, method, value);
		} else {
			setFieldValue(obj, propertyName, value);
		}
	}
1070678
protected function getValue($object, $property)
    {
        if (isset($object->{$property})) {
            return $object->{$property};
        }

        $reflectionClass = new ReflectionClass($object);

        if (!$reflectionClass->hasProperty($property)) {
            return null;
        }

        $reflectionProperty = $reflectionClass->getProperty($property);
        $reflectionProperty->setAccessible(true);

        return $reflectionProperty->getValue($object);
    }
1112877
protected function setPropertyValue(ClassProfile $profile, &$instance, $property, $value) {
		$attr = $profile->getProperty($property);
		
		if (is_object($instance) && $profile->getReflectionClass()->isInstance($instance)) {
			$attr->getReflectionProperty()->setValue($instance, $value);
			return;
		}
	
		$name = $attr->getName();
	
		if ($instance instanceof \stdClass)
			$instance->$name = $value;
		elseif (is_array($instance) || $instance instanceof \ArrayObject)
			$instance[$name] = $value;
		elseif (property_exists($instance, $name)) {
			$rc = new \ReflectionClass(get_class($instance));
			$alias = $rc->getProperty($name);
			$alias->setAccessible(true);
			$alias->setValue($instance, $value);
		}
		else
			throw new \RuntimeException(sprintf("Property %s was not found on instance of class %s", $name, get_class($instance)));
	}
1144196
protected function _setPropertyValue($property, $value)
    {
        //if a value is null and it's requires set it to the default
        //value
        $property = $this->_description->getProperty($property);
        $name = $property->getName();

        if ($property->isAttribute()) {
            $default = $property->getDefaultValue();

            if ($value === null && $default) {
                $value = $default;
            }
        }

        $this->_property[$name] = $value;
        $this->_materialized[$name] = $name;
    }
978974
public function setDocumentValue($document, $property, $value)
    {
        $setter = \Closure::bind(function ($document, $property, $value) {
                $document->$property = $value;
            }, null, $document
        );
        $setter($document, $property, $value);
    }
1108221
public function setProperty(&$object, string $propertyName, $value)
    {
        $reflection = new ReflectionClass(get_class($object));

        /** @var ReflectionProperty $property */
        $property = $reflection->getProperty($propertyName);
        $property->setAccessible(true);

        $property->setValue($object, $value);
    }
1162063
public function setPropertyValue($property, $value = NULL, $objectId = NULL)
    {

        $property = strtolower($property);
        //1. Check that the property exists in $dataModel;
        if (!array_key_exists($property, $this->propertyModel))
            return false; //@TODO Raise error? specified column not found
        //2. Validate the Value?
        if (empty($value)):
            //Attempt to get the default value;
            if (isset($this->propertyModel[$property][3])) //the third item in the array should be the default value;
                $value = $this->propertyModel[$property][3];
        endif;
        //3. Store the value with the property name in $propertyData;
        if (empty($objectId) || (int)$objectId == $this->objectId):
            $this->propertyData[$property] = $value;
            //elseif(!empty($objectId)):
            //@TODO Go to the database set the property value for this object
        endif;

        return $this;
    }
151906
public function set($property, $value = null)
    {
        if (is_string($property) && $value != '') {
            $property = [$property => $value];
        }

        foreach ($property as $name => $value) {
            $this->properties[$name] = $value;
        }

        return $this;
    }
47973
public function setProperty(&$object, $propertyName, $propertyValue)
    {
        $property = $this->getPropertyInstance($object, $propertyName);
        $property->setAccessible(true);
        $property->setValue($object, $propertyValue);
    }
17417
private function setValue($object, string $attributeName, $value)
    {
        try {
            $this->propertyAccessor->setValue($object, $attributeName, $value);
        } catch (NoSuchPropertyException $exception) {
            // Properties not found are ignored
        }
    }
532958
public static function setPropertyValue($object,$propertyName,$value)
    {
        $setter = "set" . ucfirst($propertyName);
        if (method_exists($object, $setter)) {
            $object->$setter($value);
        }
    }
1171168
protected function setProp(string $property, $value)
    {
        if (\property_exists($this, $property)) {
            $this->{$property} = $value;
        }
    }
1071491
public function setObject($object)
    {
        if (!($object instanceof IRI) && !($object instanceof Value)) {
            throw new \InvalidArgumentException('Object must be an IRI or Value object');
        }

        $this->object = $object;
    }
703584
public static function setProtectedProperty($object, $property, $value)
    {
        $refObject = new \ReflectionObject($object);
        $refProp   = $refObject->getProperty($property);
        $refProp->setAccessible(true);
        $refProp->setValue($object, $value);

        return $object;
    }