Sets a value of the object using the PropertyAccess component.

@param object $object
17417
private function setValue($object, string $attributeName, $value)
    {
        try {
            $this->propertyAccessor->setValue($object, $attributeName, $value);
        } catch (NoSuchPropertyException $exception) {
            // Properties not found are ignored
        }
    }
566455
public static void setProperty(final Object object, final Field field, final Object value) throws IllegalAccessException {
        boolean access = field.isAccessible();
        field.setAccessible(true);
        field.set(object, value);
        field.setAccessible(access);
    }
452929
public function remove($object)
    {
        foreach (array_keys($this->dataPlaceHolder) as $k) {
            if ($this->dataPlaceHolder[$k] === $object) {
                unset($this->dataPlaceHolder[$k]);

                return;
            }
        }
    }
713539
public function offsetSet($offset, $object)
    {
        if (is_int($offset) && $offset >= 0 && $offset < $this->count()) {
            $member = static::checkMember($object);
            # TODO: merge if duplicated
            if (!$this->contains($member)) {
                $this->members[$offset] = $member;
            }
        } elseif (is_null($object)) {
            $this->closed = false;
        } else {
            $this->append($object);
        }
    }
485711
protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath)
    {
        if (is_object($object)) {
            ObjectAccess::setProperty($object, $propertyName, $domainObject);
        } elseif (is_array($object)) {
            $this->injectDomainObjectInLastObject($domainObject, $lastObject, $objectArrayPropertyPath);
        }
    }
546957
protected function doAdd($object)
    {
        $this->notifyAccess();
        $this->objectsArray[$this->total] = $object;
        $this->total++;
    }
1091748
public static function setPropertiesValues($object, array $propertiesValues)
    {
        /*
         * No properties?
         * Nothing to do
         */
        if (empty($propertiesValues)) {
            return;
        }

        foreach ($propertiesValues as $property => $value) {
            static::setPropertyValue($object, $property, $value);
        }
    }
47973
public function setProperty(&$object, $propertyName, $propertyValue)
    {
        $property = $this->getPropertyInstance($object, $propertyName);
        $property->setAccessible(true);
        $property->setValue($object, $propertyValue);
    }
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);
                }
            }
        }
    }
535559
public function set($property, $value)
    {
        if($property == 'module')
        {
            $value = clone $value;

            if(is_string($value->params)) {
                $value->params = $this->getObject('object.config.factory')->fromString('json', $value->params);
            }
        }

        parent::set($property, $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);
            }
        }
    }
365947
private function setPropertyValuesToObject(Request $request, $object, array $fields): void
    {
        $objectClass = get_class($object);

        foreach ($fields as $propertyName => $attributeName) {
            $value = $request->attributes->get($attributeName);
            $propertyTypes = $this->propertyTypeExtractor->getTypes($objectClass, $propertyName);
            $propertyType = null;

            if ($propertyTypes) {
                $propertyType = array_pop($propertyTypes);
            }

            if (!$value) {
                // The value is empty. Throw exception if value cannot be nullable.
                if ($propertyType && !$propertyType->isNullable()) {
                    throw new MissingAttributeException(sprintf(
                        'Missing the attribute with name "%s" in request.',
                        $attributeName
                    ));
                }

                // We cannot get the type of property or property can be nullable.
                continue;
            }

            if ($propertyType->getBuiltinType() === Type::BUILTIN_TYPE_OBJECT) {
                // The property should be an object. Try denormalize.
                $value = $this->denormalizer->denormalize($value, $propertyType->getClassName());
            }

            $refProperty = new \ReflectionProperty($object, $propertyName);
            $refProperty->setAccessible(true);
            $refProperty->setValue($object, $value);
        }
    }
933183
protected function setProperty($object, $name = null)
    {
        if ($name === null) {
            $this->params[] = $object;
        } else {
            $this->params[$name] = $object;
        }
        return $this->make();
    }
28121
public function apply(object $object, ReflectionProperty $reflectionProperty, callable $objectCopier): void
    {
        $reflectionProperty->setAccessible(true);

        $value = ($this->callback)($reflectionProperty->getValue($object));

        $reflectionProperty->setValue($object, $value);
    }
491614
public function set($object, $key, $value)
    {
        $object->set($this->local, $value->{$this->foreign});
    }
994556
public function preUpdate($object)
    {
        $this->blockManager->get($object)->preUpdate($object);

        // fix weird bug with setter object not being call
        $object->setChildren($object->getChildren());

        if ($object->getPage() instanceof PageInterface) {
            $object->getPage()->setEdited(true);
        }
    }
307784
private function getPropertyValue($object, Property $field)
    {
        return $this->accessor->getValue($object, $field->getProperty());
    }