Update the component's value with the new value.
NOTE: this function also updates the $final_instance
array.

@param ValueComponentInterface $component The component to validate.
351075
private function update_component( ValueComponentInterface $component )
    {
        $component->value = $this->final_instance[$component->name];
        
        // Skip if this field is disabled
        if( $this->is_disabled($component) )
        {
            return;
        }

        // Apply user-defined filter
        $this->filter( $component );
        
        // Validate value
        $this->validate( $component );
    }
775980
public function addComponent( common_configuration_Component $component)
    {
        
        $components = $this->getComponents();
        
        // Search for a similar...
        foreach ($components as $c){
        	if ($c === $component){
        		// Already stored.
        		return;
        	}
        }
        
        // Not stored yet.
        $components[] = $component;
        $this->setComponents($components);
        
        
    }
73966
public function setComponentType(ComponentTypeInterface $componentType)
    {
        $this->componentTypeId = $componentType->getId();

        return parent::setComponentType($componentType);
    }
1173640
public function update($componentName)
    {
        $warningMessages = array();

        $this->executeListenerHook('onComponentUpdateStarting', array($componentName));

        foreach ($this->componentsWithUpdateFile[$componentName] as $file => $fileVersion) {
            try {
                require_once $file; // prefixed by PIWIK_INCLUDE_PATH

                $className = $this->getUpdateClassName($componentName, $fileVersion);
                if (!in_array($className, $this->updatedClasses)
                    && class_exists($className, false)
                ) {
                    $this->executeListenerHook('onComponentUpdateFileStarting', array($componentName, $file, $className, $fileVersion));

                    $this->executeSingleUpdateClass($className);

                    $this->executeListenerHook('onComponentUpdateFileFinished', array($componentName, $file, $className, $fileVersion));

                    // makes sure to call Piwik\Columns\Updater only once as one call updates all dimensions at the same
                    // time for better performance
                    $this->updatedClasses[] = $className;
                }

                $this->markComponentSuccessfullyUpdated($componentName, $fileVersion);
            } catch (UpdaterErrorException $e) {
                $this->executeListenerHook('onError', array($componentName, $fileVersion, $e));
                throw $e;

            } catch (\Exception $e) {
                $warningMessages[] = $e->getMessage();

                $this->executeListenerHook('onWarning', array($componentName, $fileVersion, $e));
            }
        }

        // to debug, create core/Updates/X.php, update the core/Version.php, throw an Exception in the try, and comment the following lines
        $updatedVersion = $this->componentsWithNewVersion[$componentName][self::INDEX_NEW_VERSION];
        $this->markComponentSuccessfullyUpdated($componentName, $updatedVersion);

        $this->executeListenerHook('onComponentUpdateFinished', array($componentName, $updatedVersion, $warningMessages));
        ServerFilesGenerator::createHtAccessFiles();
        return $warningMessages;
    }
1226788
private function updateAddressFromComponent(Address $address, $component) : Address
    {
        foreach ($component->types as $type) {
            switch ($type) {
                case 'postal_code':
                    $address->setPostalCode($component->long_name);
                    break;
                case 'locality':
                case 'postal_town':
                    $address->setLocality($component->long_name);
                    break;
                case 'country':
                    $address->setCountry($component->long_name);
                    $address->setCountryCode($component->short_name);
                    break;
                case 'street_number':
                    $address->setStreetNumber($component->long_name);
                    break;
                case 'route':
                    $address->setStreetName($component->long_name);
                    break;
                case 'administrative_area_level_1':
                case 'administrative_area_level_2':
                case 'administrative_area_level_3':
                case 'administrative_area_level_4':
                case 'administrative_area_level_5':
                case 'sublocality':
                case 'sublocality_level_1':
                case 'sublocality_level_2':
                case 'sublocality_level_3':
                case 'sublocality_level_4':
                case 'sublocality_level_5':
                case 'street_address':
                case 'intersection':
                case 'political':
                case 'colloquial_area':
                case 'ward':
                case 'neighborhood':
                case 'premise':
                case 'subpremise':
                case 'natural_feature':
                case 'airport':
                case 'park':
                case 'point_of_interest':
                case 'establishment':
                    // TODO implements method
                    break;
                default:
            }
        }

        return $address;
    }
1256478
public function update(IEventContainer $eventContainer, array $values)
    {
        $component = $eventContainer->getComponent();
        if ($component->presenter->isAjax()) {
            // ajax reset form
            $component->redrawControl($this->snippetName);
            $eventContainer->getForm()->reset();
        } else {
            // non ajax fallback
            $eventContainer->getForm()->reset();
        }
    }
358655
public function setComponents(array $components)
    {
        foreach ($components as $id => $properties) {
            $this->setComponent($id, $properties);
        }
    }
131409
public function addComponent(IComponent $component, $name, $insertBefore = NULL)
	{
		$this->container->addComponent($component, $name, $insertBefore);
		$this->ownedNames[] = $name;
	}
136363
public function set($component, $name, $value)
    {
        $this->load();

        $propertyKey = sprintf('%s__%s', $component, $name);

        if (isset($this->properties[$propertyKey])) {
            $property = $this->properties[$propertyKey];
        } else {
            $property = new Property();
            $property
                ->setComponent($component)
                ->setName($name);
            $this->entityManager->persist($property);
            $this->properties[$propertyKey] = $property;
        }

        $property->setValue($value);

        $this->entityManager->flush($property);

        return $this;
    }
1148275
public function setCommitterEmail($value)
    {
        $this->_validateString('CommitterEmail', $value);

        if ($this->data['committer_email'] === $value) {
            return;
        }

        $this->data['committer_email'] = $value;

        $this->_setModified('committer_email');
    }
1128910
public void extendComponent( Component component ) {

		if( this.extendedComponent != null )
			this.extendedComponent.extendingComponents.remove( this );

		component.extendingComponents.add( this );
		this.extendedComponent = component;
	}
541933
private function update_filterable( UI\FilterableComponentInterface $component )
    {
        $this->update_value( 
            $component, 
            $component->apply_filter( $this->new_instance[$component->get_name()] ) 
        );
    }
546635
protected function parseVCalendarComponents(Component $parentComponent)
    {
        foreach ($this->pointer['value'] ?: [] as $children) {
            switch (static::getTagName($children['name'])) {
                case 'properties':
                    $this->pointer = &$children['value'];
                    $this->parseProperties($parentComponent);
                    break;

                case 'components':
                    $this->pointer = &$children;
                    $this->parseComponent($parentComponent);
                    break;
            }
        }
    }
223210
public void setComponent(String v) {
    if (ProcessingStep_Type.featOkTst && ((ProcessingStep_Type)jcasType).casFeat_component == null)
      jcasType.jcas.throwFeatMissing("component", "edu.cmu.lti.oaqa.framework.types.ProcessingStep");
    jcasType.ll_cas.ll_setStringValue(addr, ((ProcessingStep_Type)jcasType).casFeatCode_component, v);}
1245502
public function setComponents($components)
  {
    if (ThrottlerHelper::validateComponents($components)
        && !$this->isActive())
    {
      $this->components = $components;
      return true;
    }
    return false;
  }
460781
public function set_component($component) {
        $this->areacache = null;
        list($type, $name) = core_component::normalize_component($component);
        $this->component = $type.'_'.$name;
    }
1316743
public function setComponent(QtiComponent $expression)
    {
        if ($expression instanceof Expression) {
            parent::setComponent($expression);
        } else {
            $msg = "The ExpressionEngine class only accepts QTI Data Model Expression objects to be processed.";
            throw new InvalidArgumentException($msg);
        }
    }