Transform the given array of values into a key-value pair recursively.

@param array $values

@return array
186213
public function toKeyValue(array $values)
    {
        $result = [];

        foreach ($values as $key => $value) {
            if (is_array($value)) {
                $result[$key] = $this->toKeyValue($value);
            } elseif (is_object($value)) {
                $result[$key] = $this->toKeyValue((array) $value);
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
413181
public static function convertPayjpObjectToArray($values)
    {
        $results = array();
        foreach ($values as $k => $v) {
            // FIXME: this is an encapsulation violation
            if ($k[0] == '_') {
                continue;
            }
            if ($v instanceof PayjpObject) {
                $results[$k] = $v->__toArray(true);
            } elseif (is_array($v)) {
                $results[$k] = self::convertPayjpObjectToArray($v);
            } else {
                $results[$k] = $v;
            }
        }
        return $results;
    }
255889
protected function removeEmptyValues($values)
    {
        if (!is_array($values)) {
            return empty($values) ? null : $values;
        }

        foreach ($values as $key => $value) {
            if (!empty($value)) {
                continue;
            }
            unset($values[$key]);
        }

        return $values;
    }
920932
public function transformValues( array $values )
    {
        if ( ! empty( $values['gridguyz-multisite']['defaultDomain'] ) )
        {
            $values['gridguyz-multisite']['defaultDomain'] = trim(
                $values['gridguyz-multisite']['defaultDomain'],
                '.'
            );
        }

        if ( ! empty( $values['gridguyz-multisite']['domainPostfix'] ) )
        {
            $values['gridguyz-multisite']['domainPostfix'] = '.' . trim(
                $values['gridguyz-multisite']['domainPostfix'],
                '.'
            );
        }

        return $values;
    }
80593
public function batchValues(array $values){
        ValuesImpl::batchValues($this->context, $values);
        return new OnDuplicateKeyUpdateRule($this->context);
    }
458204
public function values(array $values = [])
    {
        $values = array_combine(array_map([$this, 'trimName'], array_keys($values)), array_values($values));
        $this->values = $values;
        return $this;
    }
203930
public function whereKeys(array $values)
    {
        $repo = $this->getRepo();

        $this->select->whereIn("{$repo->getTable()}.{$repo->getPrimaryKey()}", $values);

        return $this;
    }
862256
private function createList(array $keys, array $values)
    {
        $list = [];

        foreach ($keys as $key) {
            if (array_key_exists($key, $values)) {
                $list[$key] = $values[$key];
            }
        }

        return $list;
    }
1307351
public function values(array $values)
    {
        foreach( $values as $k => $v ) {
            $this->value($k, $v);
        }
        return $this;
    }
51136
public function values( array $values )
	{
		// do nothing if we get nothing
		if ( empty( $values ) )
		{
			return $this;
		}
		
		// check if the the passed array is a collection.
		// because we want to be able to insert bulk values.
		if ( !\CCArr::is_collection( $values ) )
		{
			$values = array( $values );
		}
		
		// because we could recive the arrays in diffrent order 
		// we have to sort them by their key.
		foreach( $values as $key => $value )
		{
			ksort( $value ); $values[$key] = $value;
		}
		
		// merge the new values with the existing ones.
		$this->values = array_merge( $this->values, $values ); 
		
		// return self so we can continue running the next function
		return $this;
	}
204453
public static function flattenArrayValues(array $values): array
    {
        $return = [];

        foreach ($values as $key => $value) {
            if (\is_array($value)) {
                $value = implode(', ', $value);
            }

            $return[$key] = $value;
        }

        return $return;
    }
1085203
public function setValues(array $values = array())
    {
        foreach ($values as $k => $v) {
            $this->set($k, $v);
        }

        return $this;
    }
1110185
public function process(array $values)
    {
        $results = [];

        foreach ($values as $value) {
            $valueResults = $this->buildSolrHierarchyFromPath($value);
            $results = array_merge($results, $valueResults);
        }

        return array_unique($results);
    }
689506
public static function parseArray(array $values) {

        // Initialize the output.
        $output = [];

        // Handle each value.
        foreach ($values as $key => $value) {

            // Check if the value is null.
            if (null === $value) {
                continue;
            }

            // Check if the value is an array.
            if (true === is_array($value)) {
                $buffer = trim(implode(" ", $value));
            } else {
                $buffer = trim($value);
            }

            // Check if the buffer is not empty.
            if ("" !== $buffer) {
                $output[] = $key . "=\"" . preg_replace("/\s+/", " ", $buffer) . "\"";
            }
        }

        // Concatenates all attributes.
        return implode(" ", $output);
    }
607635
public function withValues(array $values) : self
    {
        $new = clone $this;
        foreach ($values as $property => $value) {
            $new->data[$property] = $value;
        }

        return $new;
    }
601470
public static function convertIxfObjectToArray($values)
    {
        $results = array();
        foreach ($values as $k => $v)
        {
            // FIXME: this is an encapsulation violation
            if ($k[0] == '_') {
                continue;
            }
            if ($v instanceof Object) {
                $results[$k] = $v->__toArray(true);
            } elseif (is_array($v)) {
                $results[$k] = self::convertIxfObjectToArray($v);
            } else {
                $results[$k] = $v;
            }
        }

        return $results;
    }
1344138
private function transfromArray($values)
    {
        if (count($values) > 1) {
            $encoded = array();
            foreach ($values as $value) {
                $encoded[] = $this->encodeValue($value);
            }
            return $encoded;
        } else {
            return $this->encodeValue(reset($values));
        }
    }