Tries to set values to the specified object using available setter
methods.

@param object $instance
762347
public function buildObject($instance = null)
    {
        if (is_null($instance)) {
            return (object) $this->fields;
        }
        foreach ($this->fields as $property => $value) {
            $method = 'set' . ucwords($property);
            if (is_callable([$instance, $method])) {
                $instance->{$method}($value);
            }
        }
    }
532958
public static function setPropertyValue($object,$propertyName,$value)
    {
        $setter = "set" . ucfirst($propertyName);
        if (method_exists($object, $setter)) {
            $object->$setter($value);
        }
    }
1338895
public function setValue($object, $value = null)
    {
        if (! ($object instanceof Proxy && ! $object->__isInitialized())) {
            parent::setValue($object, $value);

            return;
        }

        $originalInitializer = $object->__getInitializer();
        $object->__setInitializer(null);
        parent::setValue($object, $value);
        $object->__setInitializer($originalInitializer);
    }
143229
public static function set_form_fields($form, $instance = null)
	{
		Observer_Validation::set_fields($instance instanceof static ? $instance : get_called_class(), $form);
		$instance and $form->populate($instance, true);
	}
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;
    }
1087333
public function form( $instance ) 
    {
        // Reset the names so that the form's update function works properly
        foreach ( $this->config->fields as $field )
        {
            $field->name = $field->init_name;
        }
        // Update values
        $this->form->updater->set_new_instance( $instance );
        $this->form->updater->update();
        
        // Set the widget specific field names and ids
        foreach ( $this->config->fields as $field )
        {
            $field->id   = $this->get_field_id( $field->init_name );
            $field->name = $this->get_field_name( $field->init_name );
        }
        
        // Print the form
        $this->form->render(true);
    }
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)));
	}
6293
protected function setPropertyValue($reflection, $classInstance, $classProperty, $object)
    {
        /*
         | We will make property accessible and set the value into it
         */
        $reflection->makePropertyAccessible($classProperty);
        $reflectionProperty = $reflection->getReflectionProperty();
        $reflectionProperty->setValue($classInstance, $object);
    }
664505
public static function runSetter(&$object, string $key, $value)
    {
        $methodName = static::getMethodName($key);
        if (method_exists($object, $methodName)) {
            $object->$methodName($value);
        }
    }
121176
public void setValue(Object instance, Object value) {
        try {
            setMethod.invoke(instance, value);
        } catch (Exception e) {
            throw new PropertyNotFoundException(klass, getType(), fieldName);
        }

    }
1336198
public function setValue($object = null, $value = null)
    {
        if (!is_object($object)) {
            throw new Exception('$object is of type ' . gettype($object) . ', instance of class ' . $this->class . ' expected.', 1210859212);
        }

        if ($this->isPublic()) {
            parent::setValue($object, $value);
        } else {
            parent::setAccessible(true);
            parent::setValue($object, $value);
        }
    }
621987
public static function setInstance($type, \Tx_Oelib_Session $instance)
    {
        self::checkType($type);

        self::$instances[$type] = $instance;
    }
651729
public function setInstance($instance = 'default')
    {
        $this->get($instance);

        $this->session->put($this->prefix.'.instance', $instance);

        if (!in_array($instance, $this->getInstances())) {
            $this->session->push($this->prefix.'.instances', $instance);
        }
        $this->events->dispatch('laracart.new');

        return $this;
    }
410529
static function forceInstance(Singleton $object, $class = null)
	{
		if($class == null)
			$class = get_class($object);
		
		if(!isset(self::$instances[$class]))
		{
			self::$instances[$class] = $object;
		}
		else
		{
			throw new \Exception(sprintf('Object of class %s was previously instanciated', $class));
		}
	}
797588
public function set($name, $instance)
    {
        $key = $this->makeKey($name);

        $this->alias($name, $this->describe(get_class($instance)));

        $this->instances[$key] = $instance;

        return $this;
    }
518368
public static function set($className, $instance)
    {
        $key = self::getStorageKey($className);

        if (is_null($instance)) {
            unset(self::$instances[$key]);

            return;
        }

        self::$instances[$key] = $instance;

        return;
    }
857131
public function setPropertyValue($name, $value, $object = null)
    {
        $this->getProperty($name)->setValue($this->getObject($object), $value);

        return $this;
    }