Get an attribute array of all arrayable values.

@param  array  $values
@return array
167946
protected function getArrayableItems(array $values)
    {
        $encryptedFields = static::getEncryptedFields();

        if (count($this->getVisible()) > 0) {
            $visibles = $this->getVisible();
            $intValues = array_intersect_key($values, array_flip($visibles));

            foreach ($encryptedFields as $encryptedField) {
                if (in_array($encryptedField, $visibles) && isset($values[$encryptedField])) {
                    $intValues["{$encryptedField}_encrypted"] = $values[$encryptedField];
                }
                if (in_array($encryptedField, $visibles) && isset($values["{$encryptedField}_encrypted"])) {
                    $intValues["{$encryptedField}_encrypted"] = $values["{$encryptedField}_encrypted"];
                }
            }

            $values = $intValues;
        }

        if (count($this->getHidden()) > 0) {
            $hiddenFields = $this->getHidden();
            $values = array_diff_key($values, array_flip($hiddenFields));

            foreach ($encryptedFields as $encryptedField) {
                if (in_array($encryptedField, $hiddenFields)) {
                    unset($values["{$encryptedField}_encrypted"]);
                }
            }
        }

        return $values;
    }
495107
public function getValuesFor($attributes)
	{
		$ret = array();
		foreach ($attributes as $name) {
			if (array_key_exists($name, $this->_attributes)) {
				$ret[$name] = $this->_attributes[$name];
			}
		}
		return $ret;
	}
950169
private function prepareSelectValues(array $values) : array
    {
        $options = [];
        foreach ($values as $key => $value) {
            $options[] = [
                'id'      => $key,
                'caption' => $value,
            ];
        }
        
        return $options;
    }
685851
protected function stdWrapValues(array $values)
    {
        $renderedValues = [];

        foreach ($values as $propertyName => $propertyInstruction)
        {
            $plainPropertyName = rtrim($propertyName, '.');
            if (!empty($propertyInstruction['children.'])) {
                $renderedValues[$plainPropertyName] = $this->stdWrapValues(
                    $propertyInstruction['children.']
                );
            } else {
                $renderedValues[$plainPropertyName] = $this->cObj->stdWrap(
                    '',
                    $propertyInstruction
                );
            }
        }

        return $renderedValues;
    }
742539
public function addValues($values=array()) {
		return $this->_addOrSetValues($values, function(HtmlTR $row,$_values){$row->addValues($_values);});
	}
376646
public function get_many($values)
    {
        $this->_database->where_in($this->primary_key, $values);

        return $this->get_all();
    }
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;
    }
291995
public function getIndicesForValues(array $values)
    {
        $indices = array();

        foreach ($values as $i => $givenValue) {
            foreach ($this->values as $j => $value) {
                if ($value === $givenValue) {
                    $indices[$i] = $j;
                    unset($values[$i]);

                    if (0 === count($values)) {
                        break 2;
                    }
                }
            }
        }

        return $indices;
    }
339683
public function setValues(array $values)
    {
        foreach ($this->type->getAttributes()->getKeys() as $attribute_name) {
            if (array_key_exists($attribute_name, $values)) {
                $this->setValue($attribute_name, $values[$attribute_name]);
            }
        }

        return $this->isValid();
    }
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;
    }
1101895
protected function packValues(iterable $values): array
    {
        $packed = [];

        foreach ($values as $key => $value) {
            $id = $this->keyToId(is_int($key) ? (string)$key : $key);
            $packed[$id] = $this->pack($value);
        }

        return $packed;
    }
1281725
protected function getArrayble($attributes = [])
    {
        if(is_array($attributes))
        {
            return $attributes;
        } elseif($attributes instanceof self)
        {
            return $attributes->all();
        }elseif($attributes instanceof ArrayInterface)
        {
            return $attributes->toArray();
        }elseif($attributes instanceof JsonInterface)
        {
            return json_decode($attributes->toJson(), true);
        }elseif($attributes instanceof JsonSerialize)
        {
            return $attributes->jsonSerialize();
        }
        elseif($attributes instanceof \Traversable)
        {
            return iterator_to_array($attributes);
        }

        return (array) $attributes;
    }
630508
public static function parseAttributes($values)
    {
        $result = array();
        $values = trim($values, " \t\n\r\0\x0B()");
        $parts  = explode(',', $values);

        foreach ($parts as $part) {
            $kv    = explode('=', $part, 2);
            $key   = trim($kv[0]);
            $value = isset($kv[1]) ? $kv[1] : '';
            $value = trim($value, " \t\n\r\0\x0B\"");

            if (!empty($key)) {
                $result[$key] = $value;
            }
        }

        return $result;
    }
1209268
protected function getListValues($values)
    {
        // Empty values
        if (empty($values)) {
            return array();
        }

        // Direct array
        if (is_array($values)) {
            return array_values($values);
        }

        // Extract lists
        if ($values instanceof SS_List) {
            return $values->column('ID');
        }

        return array(trim($values));
    }
302235
public function getIndicesForValues(array $values)
    {
        trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);

        if (empty($values)) {
            return array();
        }

        $this->load();

        return parent::getIndicesForValues($values);
    }
1010060
private function all_filters( $values ) {

		foreach ( $values as $key => $value ) {
			foreach ( $this->filters as $filter ) {
				$values[ $key ] = $filter->filter( $value );
			}
		}

		return $values;
	}
28862
protected function parseRow(array $values)
    {
        $output_values = [];

        foreach ($values as $name => $value) {
            $output_values[$name] =
                $this->convertField($name, $value) ;
        }

        return $output_values;
    }