Recursively set environment variables (for each leaf).

@param array $values
@param string $prefix
@param string $separator
171018
protected function setEnvironmentVariables(array $values, $prefix, $separator = '_')
    {
        foreach ($values as $variable => $value) {
            $name = $prefix . $separator . $variable;

            if (is_array($value)) {
                $this->setEnvironmentVariables($value, $name, $separator);
            } else {
                $this->setEnvironmentVariable($name, $value);
            }
        }
    }
418735
private function setPrefixes( array $prefixes ) {
		foreach ( $prefixes as $prefix => $iri ) {
			$this->expressionValidator->validate( $prefix, ExpressionValidator::VALIDATE_PREFIX );
			$this->expressionValidator->validate( $iri, ExpressionValidator::VALIDATE_IRI );

			$this->prefixes[$prefix] = $iri;
		}

		$this->usageValidator->trackDefinedPrefixes( array_keys( $this->prefixes ) );
	}
886135
public function _addWherePlaceholder($column_name, $separator, $values)
        {
            if (!Arrays::is($column_name)) {
                $data = array($column_name => $values);
            } else {
                $data = $column_name;
            }

            $result = $this;

            foreach ($data as $key => $val) {
                $column = $result->_quoteIdentifier($key);
                $placeholders = $result->_createPlaceholders($val);
                $result = $result->_addWhere("{$column} {$separator} ({$placeholders})", $val);
            }

            return $result;
        }
932735
public function addValues($values, $prefix = null)
    {    
    	if(!is_array($values))
    	{
    		throw new MailerException('KarisMailer->setValues arrays');
    	}
    	foreach($values as $key => $value)
    	{
    		if(is_array($value))
    		{
    			unset($values[$key]);
    		}
    		elseif(is_object($value))
    		{
    			try
    			{
    				$values[$key] = $value;
    			}
    			catch(\Exception $e)
    			{
    				unset($values[$key]);
    			}
    		}
    		elseif($prefix)
    		{
    			$values[$prefix.$key] = $value;
    			unset($values[$key]);
    		}
    	}
    
    	$this->values = array_merge($this->values, $values);
    
    	return $this;
    }
72475
public static function setByPath(&$data, $paths, $value, $separator = '/', $type = 'array')
    {
        if (empty($paths)) {
            return false;
        }

        $args = is_array($paths) ? $paths : explode($separator, $paths);

        /**
         * A closure as inner function to create data store.
         *
         * @param $type
         *
         * @return  array
         *
         * @throws \InvalidArgumentException
         */
        $createStore = function ($type) {
            if (strtolower($type) === 'array') {
                return [];
            }

            if (class_exists($type)) {
                return new $type();
            }

            throw new \InvalidArgumentException(sprintf('Type %s not supported of class not exists', $type));
        };

        $dataTmp = &$data;

        foreach ($args as $arg) {
            if (is_object($dataTmp)) {
                if (empty($dataTmp->$arg)) {
                    $dataTmp->$arg = $createStore($type);
                }

                $dataTmp = &$dataTmp->$arg;
            } elseif (is_array($dataTmp)) {
                if (empty($dataTmp[$arg])) {
                    $dataTmp[$arg] = $createStore($type);
                }

                $dataTmp = &$dataTmp[$arg];
            } else {
                $dataTmp = &$createStore($type);
            }
        }

        $dataTmp = $value;

        return true;
    }
157207
protected void setArraySeparator(String arraySeparator) {
        if (arraySeparator == null) {
            arraySeparator = StringUtils.EMPTY;
        }
        this.arraySeparator = arraySeparator;
    }
509163
public static function parseParameters(array $variables, string $prefix): array
	{
		$map = function (&$array, array $keys, $value) use (&$map) {
			if (count($keys) <= 0) return $value;

			$key = array_shift($keys);

			if (!is_array($array)) {
				throw new InvalidStateException(sprintf('Invalid structure for key "%s" value "%s"', implode($keys), $value));
			}

			if (!array_key_exists($key, $array)) {
				$array[$key] = [];
			}

			// Recursive
			$array[$key] = $map($array[$key], $keys, $value);

			return $array;
		};

		$parameters = [];
		foreach ($variables as $key => $value) {
			// Ensure value
			$value = getenv($key);
			if (strpos($key, $prefix) === 0 && $value !== false) {
				// Parse PREFIX{delimiter=__}{NAME-1}{delimiter=__}{NAME-N}
				$keys = static::parseParameter(substr($key, strlen($prefix)));
				// Make array structure
				$map($parameters, $keys, $value);
			}
		}

		return $parameters;
	}
966095
public static function setByPath(&$data, string $path, $value, string $separator = '.'): void
    {
        if (false === \strpos($path, $separator)) {
            $data[$path] = $value;
            return;
        }

        if (!$nodes = \array_filter(\explode($separator, $path))) {
            return;
        }

        $dataTmp = &$data;

        foreach ($nodes as $node) {
            if (\is_array($dataTmp)) {
                if (empty($dataTmp[$node])) {
                    $dataTmp[$node] = [];
                }

                $dataTmp = &$dataTmp[$node];
            } else {
                // If a node is value but path is not go to the end, we replace this value as a new store.
                // Then next node can insert new value to this store.
                $dataTmp = [];
            }
        }

        // Now, path go to the end, means we get latest node, set value to this node.
        $dataTmp = $value;
    }
495094
public function set($prefix, $paths) {
		if (!$prefix) {
			$this->fallbackDirs = (array) $paths;
			return;
		}

		$this->prefixes[$prefix] = (array) $paths;
	}
621430
public function setEnvironment($environment)
	{
		if ($environment)
		{
			$environment = trim($environment, DIRECTORY_SEPARATOR);
		}

		$this->environment = $environment;
	}
1339418
public function setFilter($attribute, $values, $exclude = false)
    {
        $this->sphinx->setFilter($attribute, $values, $exclude);
    }
742134
public function setPrefix($prefix)
    {
        $this->prefix = $prefix;

        if (!empty($this->prefix)) {
            $this->prefix .= ".";
        }
    }
852739
protected function parseAsMultiple($value, $separator = ',')
    {
        if (is_array($value) || $value instanceof Traversable) {
            $parsed = [];
            foreach ($value as $val) {
                if (empty($val) && !is_numeric($val)) {
                    continue;
                }

                $parsed[] = $val;
            }

            return $parsed;
        }

        if ($separator instanceof PropertyInterface) {
            $separator = $separator->multipleSeparator();
        }

        if (is_object($value) && method_exists($value, '__toString')) {
            $value = strval($value);
        }

        if (empty($value) && !is_numeric($value)) {
            return [];
        }

        /**
         * This property is marked as "multiple".
         * Manually handling the resolution to array
         * until the property itself manages this.
         */
        if (is_string($value)) {
            return explode($separator, $value);
        }

        /**
         * If the parameter isn't an array yet,
         * means we might be dealing with an integer,
         * an empty string, or an object.
         */
        if (!is_array($value)) {
            return (array)$value;
        }

        return $value;
    }
950054
public function setPathPrefix($prefix)
	{
		$prefix = (string) $prefix;
		if ($prefix === '') {
			$this->pathPrefix = '';

			return;
		}

		$this->pathPrefix = \rtrim($prefix, '\\/') . $this->pathSeparator;
	}
751191
def setSeparator( self, separator ):
        
        self._separator = separator
        if ( self._navigationModel ):
            self._navigationModel.setSeparator(separator)
        self.rebuild()
422600
public function fillSchemaFields($values, $map = null, $prefix = null)
    {
        //
        if (is_array($map)) {
            foreach ($map as $alias => $field) {
                if (isset($values[$alias])) {
                    $values[$field] = $values[$alias];
                }
            }
        }

        //
        foreach (static::getSchema() as $field => $aspects) {
            if (isset($aspects['Class']) && $aspects['Relation'] == '1:1') {
                $class = $aspects['Class'];

                $this->{$field} = $class::create(
                    $values,
                    $map,
                    $prefix.$field.'__'
                );
            }

            //
            $field = $prefix.$field;

            //
            if (isset($values[$field])) {
                $this->{$field} = $values[$field];
            }
        }

        //
        $key = $this->getPrimaryKey();

        //
        $field = $prefix.$key;

        //
        if ($key) {
            $this->{$key} = isset($values[$field])
                ? (int) $values[$field]
                : (int) $this->{$key};
        }
    }
519829
protected function setConditions(&$command , array $conditionList , $separator = 'and') {
        foreach($conditionList as $condition) {
            
            $addCondition = $this->getOperator($condition->getOperator())->convert($condition);
            $this->mergeCondition($command , $addCondition , $separator);
            
        }
        return $command;
    }