The input structure is meant to be a key=>value map, the output structure
will be one as well. To every key=>value pair, internal value processors
such as "-> json_encode()" are applied.

@param array $values
@return array
433326
public function getFlatMap(array $values)
	{
		$result = [];
		foreach ($values as $key => $value) {
			self::applyValueProcessors($key, $value);
			$result[$key] = $value;
		}
		return $result;
	}
1129223
public static function convertShippoObjectToArray($values)
    {
        $results = array();
        foreach ($values as $k => $v) {
            // FIXME: this is an encapsulation violation
            if ($k[0] == '_') {
                continue;
            }
            if ($v instanceof Shippo_Object) {
                $results[$k] = $v->__toArray(true);
            } else if (is_array($v)) {
                $results[$k] = self::convertShippoObjectToArray($v);
            } else {
                $results[$k] = $v;
            }
        }
        return $results;
    }
568072
protected function getArray($values)
    {
        $values = explode(',', $values);

        array_walk($values, function (&$value) {
            $value = trim($value);
        });

        return $values;
    }
445906
protected function encodeValues(&$values)
    {
        if (is_array($values)) {
            foreach ($values as &$value) {
                $value = $this->encodeValues($value);
            }
        } elseif (is_float($values)) {
            $values = Common::forceDotAsSeparatorForDecimalPoint($values);
        } elseif (is_string($values)) {
            $values = htmlentities($values, ENT_COMPAT, 'UTF-8');
            $values = str_replace('$', '&#36;', $values);
        }
        return $values;
    }
944093
public function getSanitizedValues(&$values = [])
    {
        array_walk($this->fields, function ($field, $index) use (&$values) {
            if (is_array($field)) {
                return $this->sanitizeConditionalValues($values, $field, $index);
            }

            return $this->sanitizeValues($values[$field->getSlug()], $field);
        });

        return $values;
    }
1306356
private function getUniqueValueFromArray(array $values)
    {
        $serializedValues = false;
        foreach ($values as $key => $value) {
            if (!\is_array($value)) {
                continue;
            }

            $values[$key] = \serialize($value);

            $serializedValues = true;
        }

        if (!$serializedValues) {
            return 1 === \count(\array_unique($values)) ? $values[0] : null;
        }

        return 1 === \count(\array_unique($values)) ? \unserialize($values[0], ['allowed_classes' => true]) : null;
    }
169753
public function multiselectToArray($values)
    {
        // Unencode
        $values = unencodeMultienum($values);

        // First clean the array
        foreach ($values as $k => $v) {
            if (empty($v)) {
                unset($values[$k]);
            }
        }

        // Then return the array
        return $values;
    }
1217795
public function convert(array $values)
    {
        $tmp = [];

        foreach ($values as $key => $value) {
            $tmp[strtolower($key)] = $value;
        }

        return $this->hydrate($tmp);
    }
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;
	}
381291
public function valuesArray($values) {
		if ($values instanceof \ArrayObject)
			$this->value = $values->getArrayCopy();
		elseif (is_object($values))
			$this->value = get_object_vars($values);
		elseif (is_array($values))
			$this->value = $values;
		else
			throw new \InvalidArgumentException("Method 'valuesArray' expected an object or array value");
		
		if (is_numeric(key($this->value))) {
			$this->valueList = $this->value;
			$this->value = null;
		}
		
		return $this;
	}
1126653
public function preparedResults($values)
    {
        $preparedValues = [];

        /* @var $col Col */
        /* @var $field Field */
        foreach ($this->select as $pos => $selectColumn) {
            $col = $selectColumn[0];
            $field = $col->getOutputField();
            $val = ArrayHelper::getValue($values, $pos);
            // first use the inbuilt converters
            try {
                $val = Type::getType(
                    $field->dbType($this->connection)
                )->convertToPHPValue($val, $this->connection->getDatabasePlatform());
            } catch (DBALException $exception) {
            }

            // use the field converters if any were provided by the user.
            $converters = $field->getDbConverters($this->connection);

            if ($converters) {
                foreach ($converters as $converter) {
                    $val = call_user_func($converter, $this->connection, $val, $field);
                }
            }
            $preparedValues[] = $val;
        }

        return $preparedValues;
    }
731501
public static function convertMaestranoObjectToArray($values)
  {
    $results = array();
    foreach ($values as $k => $v) {
      // FIXME: this is an encapsulation violation
      if ($k[0] == '_') {
        continue;
      }

      // Convert key to underscore
      $kReal = self::toUnderscore($k);

      if ($v instanceof Maestrano_Api_Object) {
        $results[$kReal] = $v->__toArray(true);
      } else if (is_array($v)) {
        $results[$kReal] = self::convertMaestranoObjectToArray($v);
      } else if ($v instanceOf DateTime) {
        $results[$kReal] = $v->format(Maestrano_Helper_DateTime::ISO8601);
      } else {
        $results[$kReal] = $v;
      }
    }
    return $results;
  }
496500
protected function setValuesList(array $values) {
        $parseValues =  [];
        foreach ($values as $value) {
            $parseValues[] = $this->getDriverEscaper()->quote($this->getDriverEscaper()->escape($value));
        }
        return '(' . implode(' ' . $this->getDriverEscaper()->getFieldsSeparator() . ' ' ,  $parseValues) . ')';
    }
908524
public static function flatten(array $values)
    {
        $results = [];

        array_walk_recursive(
            $values,
            function($value) use (&$results) {
                $results[] = $value;
            }
        );

        return $results;
    }
1097186
public function setValuesRaw($values = array())
    {
        foreach ($values as $key => $value) {
            $this->setRaw($key, $value);
        }

        return $this;
    }
779770
public function filterValues(array $values = null)
    {
        if (null === $values) {
            $values = $this->getFields();
        }
        foreach ($values as $key => $value) {
            $values[$key] = $this->filterValue($value);
        }
        return $values;
    }
1033696
protected function getVersionValues(array $values)
    {
        $array = [];

        $versionedKeys = $this->model->getVersionedAttributeNames();

        foreach ($values as $key => $value) {
            if ($newKey = $this->isVersionedKey($key, $versionedKeys)) {
                $array[$newKey] = $value;
            }
        }

        return $array;
    }