Set all the properties from given array values.

@param array $properties
@throws \RuntimeException
@throws \Exception
778478
public function setProperties(array $properties = [])
    {
        foreach ($properties as $property => $value) {
            $method = 'set'.ucfirst($property);
            if (!method_exists($this, $method)) {
                throw new \RuntimeException("Undefined method $method.");
            }

            if (!in_array($property, $this->validProperties)) {
                throw new \Exception('You are trying to set invalid properties. Please check valid properties.');
            }

            $this->{$method}($value);
        }
    }
1044931
public function setOptionsProperty(array $properties)
    {
        if (Helpers::isKeyExists($properties, 'options') && is_array($properties['options'])) {
            $labels = $this->transferOptionsToLabels($properties['options']);

            foreach ($labels as $label) {
                $this->addOption($label->text, $label->isPlain, $label->lang, $label->value);
            }

        }

        return $this;
    }
993203
public function index($properties)
    {
        $properties = (array) $properties;

        foreach ($properties as $property)
        {
            $this->addCommand('index', ['property' => $property]);
        }
    }
664278
public function initAnnotation(array $properties) {
		if (isset ( $properties [0] )) {
			$this->type = $properties [0];
			unset ( $properties [0] );
			if (isset ( $properties [1] )) {
				if (! is_array ( $properties [1] )) {
					$this->constraints = [ "ref" => $properties [1] ];
				} else {
					$this->constraints = $properties [1];
				}
				unset ( $properties [1] );
			}
		} else {
			throw new \Exception ( 'Validator annotation must have a type' );
		}
		parent::initAnnotation ( $properties );
		if (! isset ( ValidatorsManager::$validatorTypes [$this->type] )) {
			throw new \Exception ( 'This type of annotation does not exists : ' . $this->type );
		}
	}
1062236
public function setIdentification($properties)
    {
        $this->reset($properties);

        if (!empty($this->model)) {
            $this->generic = false;
        }
        
        $this->identified |= Constants\Id::MATCH_UA;
    }
821048
public function setFields(array $fields,array $values)
        {
                $count = count($fields);
                if($count!=count($values)) {
                        throw new \Exception('fields num != values num');
                }
                $params = [];
                for ($i=0; $i<$count; $i++) {
                        $params[] = $fields[$i];
                        $params[] = $values[$i];
                }
                return $this->_redis->hmset($this->_key, $params);
        }
17577
public function reset($properties = null)
    {
        parent::reset();

        unset($this->family);
        unset($this->edition);

        $this->hidden = false;

        if (is_array($properties)) {
            $this->set($properties);
        }
    }
105234
public function setProperties(array $properties) : DataSet
    {
        $this->properties = [];

        foreach ($properties as $key => $value) {
            $this->addProperty($key, $value);
        }

        return $this;
    }
966807
public function setAll(array $values): void {
		$skipped = array();
		
		foreach ($values as $key => $value) {
			try {
				$this->set($key, $value);
			} catch (EntityException $e) {
				$skipped[$key] = $value;
			}
		}
		
		if (($skippedCount = sizeof($skipped)) > 0) {
			$message = sprintf("Unknown %s (%s) in %s.",
				$skippedCount === 1 ? "property" : "properties",
				join(", ", $skipped),
				get_class()
			);
			
			throw new EntityException($message, EntityException::UNKNOWN_PROPERTY);
		}
	}
813610
public function setDataFromArray(array $values = array())
    {
        foreach ($values as $key => $value) {

            $desiredKey = $this->trimPrefixKey($key);

            $propertyName = $this->getPropertyName($desiredKey);
            $setterMethodName = 'set' . ucfirst($propertyName);

            // Direct setter exists into object, just use it
            if (method_exists($this, $setterMethodName) && $value !== null) {
                $this->$setterMethodName($value);
            } elseif ($value !== null) {
                // Otherwise, try to get sub object to set data
                $this->setDataForSubEntitiy($desiredKey, $value);
            }
        }
        return $this;
    }
1003295
function setValues (array $values = array())
    {
        foreach ($this->getFields() as $field)
            if (array_key_exists($field->getName(), $values))
                $field->setValue($values[$field->getName()]);
        foreach ($this->dataFields as $dataKey => $dataVal)
            if (array_key_exists($dataKey, $values))
                $this->dataFields[$dataKey] = $values[$dataKey];
    }
394683
final public function setConditions(array $conditions)
    {
        if ($this->hasRun) {
            throw new \RuntimeException("Cursor query has already run");
        }

        $this->conditions = $this->applyConditions($conditions);
    }
1311904
public function setAll(array $values) {
		foreach ($values as $name => $value) {
			$this->set($name, $value);
		}
	}
686027
public function setProperties($properties)
    {
        parent::setProperties($properties);

        //Set the user data
        $this->getSession()->set('user', ObjectConfig::unbox($properties));

        return $this;
    }
1349309
public function fromRaw($properties)
	{
		$this->validateProperties($properties);

		foreach ($properties as $property => $value) {
			$this->properties[$property] = $value;
		}
	}
1015825
public function setFields(array $fields)
    {
        foreach ($fields as $field => $value) {
            if (property_exists($this, $field)) {
                $this->{$field} = $value;
            }
        }

        if (isset($fields['_embedded'])) {
            foreach ($fields['_embedded'] as $embeddedType => $embeddedValue) {
                if (property_exists($this, $embeddedType)) {
                    $propertyObject = $this->factory->createFromPropertyName($embeddedType);
                    if ($propertyObject === null) {
                        continue;
                    }

                    if (is_array($propertyObject)) { //Property is a collection
                        foreach ($embeddedValue as $entityType => $entityFields) {
                            $entityObject = $this->factory->createFromPropertyName($entityType);
                            if ($entityObject === null) {
                                continue;
                            }

                            $entityObject->setFields($entityFields);

                            $propertyObject[] = $entityObject;
                        }
                    } else { //Property is an entity
                        $propertyObject->setFields($embeddedValue);
                    }

                    $this->{$embeddedType} = $propertyObject;
                }
            }
        }
    }
1058681
public function setFromArray(array $fields)
    {
        foreach($fields as $key => $value)
        {
                $this->fields[$key] = $value;
                unset($key);
                unset($value);
        }
    }