Populates the inherited object with input vars with same name as properties.

@param	string	Optional list of properties to populate, comma separated. If no items,
will tries to populate all fields.
357435
final public function populateByRequest() {

		$args = func_get_args();

		// all subclass binds
		$binds = static::getBinds();

		foreach ($binds as $property => $field) {

			// check that property is in the args or that args is not defined at all
			if (!count($args) or (isset($args[0]) and in_array($property, $args[0]))) {
				
				$type = $this->getPropertyType($property);
				
				if (Input::isSent($property) or 'bool' == $type) {
					
					// assign the value to this object property
					$this->__set($property, Input::get($property));
					
				}

			}

		}

	}
926389
public function applyData ( $data = NULL ) {
        if (NULL != $data && is_array( $data )) {
            foreach ($data as $propName => $propValue) {
                $this->assignValue( $propName, $propValue );
            }
        } else {
            $this->buildVars();
        }
    }
78
public void populate(Object target, Map properties) throws BeanMappingException {
        BeanMappingParam param = new BeanMappingParam();
        param.setSrcRef(properties);
        param.setTargetRef(target);
        param.setConfig(this.populateConfig);
        param.setProcesses(BeanMappingEnvironment.getBeanMapVps());
        // 执行mapping处理
        BeanMappingExecutor.execute(param);
    }
387714
public static function collect(
        string $className,
        $objectAnnotation = null,
        string $propertyName = '',
        string $methodName = '',
        $propertyValue = null
    ) {
        if ($objectAnnotation instanceof Strings) {
            self::collectString($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Floats) {
            self::collectFloats($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Number) {
            self::collectNumber($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Integer) {
            self::collectInteger($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Enum) {
            self::collectEnum($objectAnnotation, $className, $methodName);
        }
    }
1097717
public function _init($options)
    {
		if(is_array($options)) {
			foreach($options as $opt_name => $opt_val) {
				if(property_exists($this, $opt_name)) {
					$this->$opt_name = $opt_val;
				}
			}
		}
    }
748349
public function initialize(array $properties = null)
    {
        $attributes = [];
        $embedOne = [];
        $embedMany = [];

        if (null !== $properties) {
            $attributes = $this->applyDefaultAttrValues($attributes);
            foreach ($properties as $key => $value) {
                if (true === $this->isAttribute($key)) {
                    // Load attribute.
                    $attributes[$key] = $this->convertAttributeValue($key, $value);
                } else if (true === $this->isEmbedHasOne($key) && is_array($value)) {
                    // Load embed one.
                    $embedOne[$key] = $this->getStore()->loadEmbed($this->getMetadata()->getEmbed($key)->embedMeta, $value);
                }
            }
        }

        foreach ($this->getMetadata()->getEmbeds() as $key => $embeddedPropMeta) {
            // Always load embedded collections, regardless if data is set.
            if (true === $embeddedPropMeta->isOne()) {
                continue;
            }
            $embeds = !isset($properties[$key]) ? [] : $properties[$key];
            $embedMany[$key] = $this->getStore()->createEmbedCollection($embeddedPropMeta, $embeds);
        }

        $this->attributes    = (null === $this->attributes) ? new Attributes($attributes) : $this->attributes->replace($attributes);
        $this->hasOneEmbeds  = (null === $this->hasOneEmbeds) ? new Embeds\HasOne($embedOne) : $this->hasOneEmbeds->replace($embedOne);
        $this->hasManyEmbeds = (null === $this->hasManyEmbeds) ? new Embeds\HasMany($embedMany) : $this->hasManyEmbeds->replace($embedMany);

        if (true === $this->getState()->is('new')) {
            // Ensure default values are applied to new models.
            $this->apply([]);
        }

        $this->doDirtyCheck();
        return $this;
    }
706484
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            int intValue = Integer.parseInt(strValue);
            set(intValue);
        } catch (NumberFormatException nfe) {
        }
    }
935384
protected function prepareParams($object,&$params) {
        //Get all readble object properties
        $properties = get_object_vars($object);
    
        /**
         * For each property, if it is instance of AbstractRequest, recursive function called
         * Else if value of property is scalar we assign it
         */
        foreach ($properties as $p=>$v){
            if(is_object($v) && $v instanceof AbstractRequest){
                
                $this->prepareParams($v,$params);
            }
            if(is_scalar($v)){
                $params[$p] = $v;
            }
        }
    
    }
923963
public void setProperties(Collection<String> properties) {
        if (null == this.properties) {
            this.properties = new ArrayList<>();
        }
        this.properties.clear();
        this.properties.addAll(properties);
    }
3717
protected function initializeProperties($properties = null)
    {
        $this->getPropertiesInfo();

        // Initialize the properties that were defined using the Initialize / InitializeObject annotations
        $initializeValueValidationEnabled = Configuration::isInitializeValuesValidationEnabled();
        foreach ($this->_initialPropertiesValues as $propertyName => $initialization) {
            $value = null;
            switch ($initialization['type']) {
                case 'initialize':
                    $value = $initialization['value'];
                    break;
                default:
                    $className = $initialization['value'];
                    $value = new $className();
                    break;
            }

            if ($initializeValueValidationEnabled) {
                $this->assertPropertyValue($propertyName, $value);
            }

            $this->$propertyName = $value;
            $this->updateInitializedPropertyValue($propertyName, $value);
        }

        // Initialize the propeties using given arguments
        if ($this->_initializationNeededArguments !== null && $properties !== null) {
            $numberOfNeededArguments = count($this->_initializationNeededArguments);

            MethodCallManager::assertArgsNumber($numberOfNeededArguments, $properties);

            for ($i = 0; $i < $numberOfNeededArguments; $i++) {
                $propertyName = $this->_initializationNeededArguments[$i];
                $argument = $properties[$i];

                $this->assertPropertyValue($propertyName, $argument);
                $this->$propertyName = $argument;
                $this->updateInitializedPropertyValue($propertyName, $argument);
            }
        }
    }
268330
final private function populate($dbRow) {
		
		$this->beforePopulate($dbRow);
		
		$class = get_called_class();
		$varFields = $class::getBinds();
		
		foreach ($varFields as $objProperty => $dbField) {

			// cast it and assign
			$this->__set($objProperty, $dbRow->$dbField);
			
		}
		
		$this->afterPopulate(); 
		
	}
63429
public void setValue(Properties properties)  {
        if (properties == null) {
            throw new IllegalArgumentException("properties must not be null");
        }
        if (type == null) {
            type = ItemType.PROPERTIES;
        }
        if (!isMappableType()) {
            throw new IllegalArgumentException("The type of this item must be 'properties' or 'map'");
        }
        tokensMap = new LinkedHashMap<>();
        for (String key : properties.stringPropertyNames()) {
            Object o = properties.get(key);
            if (o instanceof Token[]) {
                tokensMap.put(key, (Token[])o);
            } else if (o instanceof Token) {
                Token[] tokens = new Token[] { (Token)o };
                tokensMap.put(key, tokens);
            } else {
                Token[] tokens = TokenParser.makeTokens(o.toString(), isTokenize());
                putValue(name, tokens);
            }
        }
    }
57152
public function populateValues($data)
    {
        /** @var FieldsetInterface|ElementInterface $element*/
        foreach ($this->elements as $element) {
            if (is_a($element, '\Slick\Form\FieldsetInterface')) {
                $element->populateValues($data);
            } else {
                foreach ($data as $name => $value) {
                    if ($element->getName() == $name) {
                        $element->setValue($value);
                    }
                }

            }
        }
    }
415738
public function property($name, $type = null, $db_location = null, $with_form = 0, $restrictions = array(), $form_components = array()) {

    if (is_a($name, 'XClassProperty')) {
      $this->properties[$name->name()] = $name;
    } else {
      if (is_array($name)) {
        $current_property = new XClassProperty($name);
        $this->properties[$current_property->name()] = $current_property;
      } else {

        $current_property = new XClassProperty(
                                                array(
                                                  'name'  =>  $name,
                                                  'type'  =>  $type,
                                                  'defaultValue'  =>  null,
                                                  'value'   =>  null,
                                                  'db_location' => $db_location
                                                )
                                              );

        $this->properties[$name] = $current_property;

      }
    }
	}
876194
public function generateGettersAndSettersFromProperties()
    {
        $propertyIterator = $this->getPropertyCollection()->getIterator();
        foreach ($propertyIterator as $property) {
            $this->getMethodCollection()->add(Method::createGetterFromProperty($property));
            $this->getMethodCollection()->add(Method::createSetterFromProperty($property));
        }
    }
928583
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }
        if (isset($data['locale']) && $data['locale'] !== null) {
            $this->locale = $data['locale'];
        }
    }
634793
public function populate($input, $repopulate = false)
	{
		$fields = $this->field(null, true, false);
		foreach ($fields as $f)
		{
			if (is_array($input) or $input instanceof \ArrayAccess)
			{
				// convert form field array's to Fuel dotted notation
				$name = str_replace(array('[',']'), array('.', ''), $f->name);

				// fetch the value for this field, and set it if found
				$value = \Arr::get($input, $name, null);
				$value === null and $value = \Arr::get($input, $f->basename, null);
				$value !== null and $f->set_value($value, true);
			}
			elseif (is_object($input) and property_exists($input, $f->basename))
			{
				$f->set_value($input->{$f->basename}, true);
			}
		}

		// Optionally overwrite values using post/get
		if ($repopulate)
		{
			$this->repopulate();
		}

		return $this;
	}