Sets the private/protected property value by its name.

@param object|string $object
@param string $name
@param mixed $value
420711
protected function setInaccessibleProperty($object, $name, $value)
    {
        $property = $this->getProperty($object, $name);
        $property->setAccessible(true);
        $property->setValue(is_object($object) ? $object : null, $value);
    }
251067
public function set($name, $value)
    {
        //If it's an object, save its ID as the parameter
        if(is_object($value) && method_exists($value, 'getId'))
        {
            $this->parameters[$name] = $value->getId();
        }

        //Just save the parameter
        else
        {
            $this->parameters[$name] = $value;
        }

        return $this;
    }
1115049
public static function setPropertyValue($object, $property, $value)
    {
        $reflectionProperty = self::getProperty($object, $property);

        // Oops, property does not exist
        if (null === $reflectionProperty) {
            throw NotExistingPropertyException::create($object, $property);
        }

        $isPublic = $reflectionProperty->isPublic();

        if (!$isPublic) {
            $reflectionProperty->setAccessible(true);
        }

        $reflectionProperty->setValue($object, $value);

        if (!$isPublic) {
            $reflectionProperty->setAccessible(false);
        }
    }
491937
public function set($name, $value)
    {
        if (is_array($value)) {
            $value = new ObjectConfig($value);
        }

        parent::set($name, $value);
    }
290925
protected function assignProperty($name, $value)
    {
        if (!empty($this->propertyTypes[$name]) && $value !== null) {
            if (!($value instanceof $this->propertyTypes[$name])) {
                throw new Exception(
                    sprintf("You can't put an instance of %s in the parameter $%s of type %s",
                        get_class($value), $name, $this->propertyTypes[$name]
                    )
                );
            }
        }
        if ($this->frozen && in_array($name, $this->restrictedProperties)) {
            throw new Exception(
                sprintf("You can't change the protected or private parameter $%s of type %s",
                    $name, !empty($this->propertyTypes[$name]) ? $this->propertyTypes[$name] : "scalar"
                )
            );
        }
        $this->$name = $value;
    }
185520
public function set($name, $value)
    {
        $name = '_' . (string)$name;
        if (property_exists($this, $name) && (!is_array($this->$name))) {
            $this->$name = $value;
        }
        return $this;
    }
892707
public static function set(array &$object, $keys, $value)
    {
        $keys = explode('.', $keys);
        $depth = count($keys);
        $key = array_shift($keys);

        if (1 === $depth) {
            $object[$key] = $value;
        } else {
            if (!isset($object[$key])) {
                $object[$key] = [];
            } elseif (!is_array($object[$key])) {
                throw new \Exception('Cannot set property because it already exists as a non \stdClass');
            }

            static::set($object[$key], implode('.', $keys), $value);
        }
    }
924323
public function set($name, $value) : void
    {
        $_SESSION[$name] = $value;

        parent::set($name, $value);
    }
161306
protected function setValue($object, $value, $setter)
    {
        if (method_exists($object, $setter)) {
            $object->$setter($value);
        }
    }
618700
public static function setPropertyValue($object, $property, $value): void
    {
        $ref = new \ReflectionClass($object);
        $prop = static::getPrivateProperty($ref, $property);
        $prop->setAccessible(true);
        $prop->setValue($object, $value);
        $prop->setAccessible(false);
    }
571853
public static function set(& $object, $key, $value)
    {
        if (static::isArray($object))
            $object[$key] = $value;

        if (static::isObject($object))
            $object->$key = $value;

        return $object;
    }
760728
protected function setProperty($object, $name)
    {
        $this->loadPropertyTypes();
        if (empty($this->restrictedProperties) && $this->frozen) {
            $this->restrictedProperties = $this->getRestrictedProperties(get_class());
        }
        if ($name) {
            $this->assignProperty($name, $object);
        } else {
            $objectClass = get_class($object);
            $match = null;
            foreach ($this->propertyTypes as $name => $type) {
                if ($object instanceof $type) {
                    if ($match) {
                        throw new \FW\DI\Exception("You must specify a name for the property of type $objectClass,
                        since at least two parameters ($match and $name) share the same class");
                    }
                    $match = $name;
                }
            }
            if (!$match) {
                // We gave an unused class in the DI, it doesn't serve any purpose but it won't break the build
                trigger_error("Object of class $objectClass given to " . get_class() . " but it seems unused.", E_USER_WARNING);
            } else {
                $this->assignProperty($match, $object);
            }
        }
        return $this;
    }
49265
public function setProperty($name,$value) {
        if(property_exists($this,$name))
            $this->$name = $value;
        return $this;
    }
1003167
public function setVariable(string $name, $value = null): void
    {
        [$name, $value] = $this->normaliseVariable($name, $value);

        $this->attributes[$name] = $value;

        if (!$this->setter || ($this->immutable && !is_null($this->getVariable($name)))) {
            return;
        }

        putenv("{$name}={$value}");
        $_ENV[$name] = $value;
        $_SERVER[$name] = $value;
    }
107807
public function set(string $name, $value = null) : void
    {
        Arr::set($this->registry, $name, $value);
    }
175221
public function setParam($name, $value) {
        $parts = explode('.', $name);
        $currentObject = $this->getParams();
        foreach($parts as $key=>$part) {
            if($key+1==count($parts)) {
                $currentObject->$part = $value;
            } else {
                if (!property_exists($currentObject, $part)) {
                    $currentObject->$part = new stdClass();
                }
                $currentObject = $currentObject->$part;
            }
        }
    }
1325558
public function _set($name, $value)
    {
        $object = $this->getObject();
		$callable = function() use ($name, $value, $object) {
			if (!property_exists($object, $name) && !method_exists($object, '__set'))
			{
				throw new \Exception('Property ' . $name . ' doesn\'t exist on object of class ' . get_class($object));
			}
			$object->$name = $value;
		};
		$this->breakScopeAndExecute($callable);
    }