Groups set of values into one value separated with Resources::SEPARATOR.

@param array $values array of values to be grouped

@return string
4252
public function groupQueryValues(array $values)
    {
        $joined = Resources::EMPTY_STRING;

        foreach ($values as $value) {
            if (!is_null($value) && !empty($value)) {
                $joined .= $value.Resources::SEPARATOR;
            }
        }

        return trim($joined, Resources::SEPARATOR);
    }
721564
public function fromArray(array $values)
    {
        foreach ($values as $property => $value) {
            $this->__set($property, $value);
        }
        
        return $this;
    }
811095
public function filter($value)
    {
        if (!is_scalar($value) && !is_array($value)) {
            return $value;
        }

        return str_replace('-', $this->separator, $value);
    }
639120
private function buildValuesPart($values)
    {
        $columnNames = [];
        $placeholders = [];
        foreach ($values as $columnName => $placeholder) {
            $columnNames[] = $this->quoteIdentifier($columnName);
            $placeholders[] = $placeholder;
        }

        return "\n( " . implode(', ', $columnNames) . ' ) VALUES ( ' . implode(', ', $placeholders) . ' )';
    }
850424
private function getContentTypeTableColumnType(array $values)
    {
        // Multi-value selects are stored as JSON arrays
        if (isset($values['type']) && $values['type'] === 'select' && isset($values['multiple']) && $values['multiple'] === true) {
            return 'selectmultiple';
        }

        return $values['type'];
    }
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;
    }
871740
public function filterCategoryValues($values)
    {
        return array_unique(preg_split(
            '/\s*,\s*/u',
            preg_replace('/\s+/u', ' ', is_array($values) ? implode(',', $values) : $values),
            -1,
            PREG_SPLIT_NO_EMPTY
        ));
    }
1217094
private function getDirection(array $values)
    {
        $direction = 'asc';

        if (array_key_exists(1, $values)) {
            $direction = $values[1];
        }

        switch (strtolower($direction)) {
            case 'asc':
                return Query::SORT_ASC;
            case 'desc':
                return Query::SORT_DESC;
        }

        throw new InvalidArgumentException(
            "Could not handle sort direction '{$direction}'"
        );
    }
853915
public function setValues(array $values) : CheckboxGroup
    {
        foreach ($this->checkboxes as $checkbox) {
            $checkbox->setChecked(in_array($checkbox->getValue(), $values, true));
        }

        return $this;
    }
422313
public function intoValues(array $values)
    {
        if (is_array($values[0])) {
            $this->intoValues = $values;
        } else {
            $this->intoValues[] = $values;
        }
        return $this;
    }
968387
protected function arrayToHtmlAttributes(array $values)
    {
        $output = "";
        ksort($values);

        foreach ($values as $key => $value) {
            $output .=  sprintf('%s="%s" ', htmlentities($key), htmlentities($value));
        }

        return $output;
    }
559729
static function fromArray($values)
    {
        if ($values === null) {
            return null;
        }

        ksort($values);

        $serialized = '';
        foreach ($values as $key => $value) {
            if (is_array($value)) {
                list($key, $value) = array($value[0], $value[1]);
            }

            if (strpos($key, ':') !== false) {
                return null;
            }

            if (strpos($key, "\n") !== false) {
                return null;
            }

            if (strpos($value, "\n") !== false) {
                return null;
            }
            $serialized .= "$key:$value\n";
        }
        return $serialized;
    }
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;
    }
1227775
private function toStrings($values)
    {
        foreach ($values as &$value) {
            if ($value instanceof \Datetime) {
                $value = $value->format('Y-m-d H:i:s');
            } elseif ($value) {
                $value = (string) $value;
            }
        }

        return $values;
    }
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;
	}
943895
protected function _cleanData($values)
    {
        $linebreak = $this->getLinebreak();

        if (is_array($values)) {
            ksort($values);
        }
        $retVal = '<div class="pre">';
        foreach ($values as $key => $value)
        {
            $key = htmlspecialchars($key);
            if (is_numeric($value)) {
                $retVal .= $key.' => '.$value.$linebreak;
            }
            else if (is_string($value)) {
                $retVal .= $key.' => \''.htmlspecialchars($value).'\''.$linebreak;
            }
            else if (is_array($value))
            {
                $retVal .= $key.' => '.self::_cleanData($value);
            }
            else if (is_object($value))
            {
                $retVal .= $key.' => '.get_class($value).' Object()'.$linebreak;
            }
            else if (is_null($value))
            {
                $retVal .= $key.' => NULL'.$linebreak;
            }
        }
        return $retVal.'</div>';
    }
190375
public function separator(string $value = null)
    {
        if (null === $value) {
            return $this->separator;
        }
        $this->separator = $value;
        return $this;
    }