Massage attribute values. The CSV needs a flat array.

@return array
548854
protected function mapExportAttributes($attributes)
    {
        return collect($attributes->toArray())->map(function($value, $key) {
            return $this->mapExportAttribute($value, $key);
        })->toArray();
    }
496956
public function getAttributes(): array
    {
        $attributes = [];
        foreach ($this->wires as $address => $amount) {
            $attributes['wires'][$address] = AdsConverter::clicksToAds($amount);
        }

        return $attributes;
    }
415443
public function toArray()
    {
        $attribute_values = [ self::OBJECT_TYPE => $this->getType()->getPrefix() ];

        foreach ($this->value_holder_map as $attribute_name => $value_holder) {
            $attribute_value = $value_holder->getValue();

            if (is_object($attribute_value) && is_callable([ $attribute_value, 'toArray' ])) {
                $attribute_values[$attribute_name] = $attribute_value->toArray();
            } else {
                $attribute_values[$attribute_name] = $value_holder->toNative();
            }
        }

        return $attribute_values;
    }
346386
public function stringArrayToCsv()
    {
        $value = $this->getParameter('value');
        if (!is_array($value)) {
            $value = explode($this->getParameter('delimiter', ','), $value);
        }

        $value = array_map('trim', $value);
        if (empty($value)) {
            return '';
        }
        $value = array_filter($value, 'strlen');

        if ($this->getParameter('lowercase', false)) {
            $value = array_map('strtolower', $value);
            if ($this->getParameter('unique', true)) {
                $value = array_keys(array_flip($value));
            }
        } else {
            if ($this->getParameter('unique', true)) {
                $value = array_values(array_intersect_key($value, array_unique(array_map('strtolower', $value))));
            }
        }

        return implode(',', $value);
    }
1199173
public function getAttributes()
    {
        $attributes = (array) $this->serializer->getAttributes($this->data, $this->getOwnFields());

        $attributes = $this->filterFields($attributes);

        $attributes = $this->mergeAttributes($attributes);

        return $attributes;
    }
127525
public function toArray()
	{
		return array(
			'types' => &$this->types,
			'attributes' => &$this->attributes,
			'attributeGroups' => &$this->attributeGroups,
			'elements' => &$this->elements,
			'processedSchemas' => &$this->processedSchemas,
			'typeIds' => &$this->typeIds,
		);
	}
1093677
public function getAttributes() {
        $values = func_get_args();
        if (count($values) === 1) {
            $result = [];
            foreach ($values as $value) {
                $result[$value] = @$this->attributes[$value];
            }
            return $result;
        } elseif (count($values) > 1) {
            return @$this->attributes[$values[0]];
        } else {
            return $this->attributes;
        }
    }
1002719
public function getAttributes()
    {
        $attributes = array_merge(
            parent::getAttributes(),
            [
                'data-depth' => $this->Depth,
                'data-zoom' => $this->Zoom,
                'data-zoom-min' => $this->ZoomMin,
                'data-zoom-max' => $this->ZoomMax,
                'data-canvas' => $this->CanvasCSSID,
                'data-tag-list' => $this->TagListID,
                'data-color-text' => $this->ColorText,
                'data-color-outline' => $this->ColorOutline,
                'data-weight-size-min' => $this->WeightSizeMin,
                'data-weight-size-max' => $this->WeightSizeMax,
                'data-initial' => $this->Initial,
                'data-weight' => $this->dbObject('Weight')->NiceAsBoolean()
            ]
        );
        
        return $attributes;
    }
406990
public function getAttributes()
    {
        $attributes = parent::getAttributes();

        $values = $this->getValues();
        if (isset($values)) {
            $attributes['values'] = $values;
        }

        return $attributes;
    }
874784
public function getAttributes(): array
    {
        $attributes['address'] = $this->address;
        $attributes['amount'] = AdsConverter::clicksToAds($this->amount);
        if ($this->message) {
            $attributes['message'] = $this->message;
        }
        return $attributes;
    }
1249602
protected function getDataAttrs(): array
    {
        $attrs = array_filter($this->html->getAttributes(), static function ($v, $k) {
            return strpos($k, 'data-') === 0;
        }, ARRAY_FILTER_USE_BOTH);

        $dataAttrs = [];

        foreach ($attrs as $key => $value) {
            $key = substr($key, 5);

            $dataAttrs[$key] = $value;
        }

        return $dataAttrs;
    }
1312959
public function getAttributeRules()
    {
        $result = [];
        $attributes = $this->getAttributesFromSchema();
        $casts = $this->getCasts();
        $casts_back = $this->getAttributesFromSchema('cast-back', true);
        $rules = $this->getAttributesFromSchema('rules', true);

        // Build full rule for each attribute.
        foreach ($attributes as $key) {
            $result[$key] = [];
        }

        // If any casts back are configured, replace the value found in casts.
        // Handy if we read integer values as datetime, but save back as an integer.
        $casts = array_merge($casts, $casts_back);

        // Build full rule for each attribute.
        foreach ($casts as $key => $cast_type) {
            $cast_validator = $this->parseCastToValidator($cast_type);

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

            if ($this->exists) {
                $result[$key][] = 'sometimes';
            }
        }

        // Assign specified rules.
        foreach ($rules as $key => $rule) {
            $result[$key][] = $rule;
        }

        unset($result[$this->getKeyName()]);

        foreach ($result as $key => $rules) {
            $result[$key] = implode('|', $rules);
        }

        return $result;
    }
395547
public function getAttributes():array
    {
        $attributes = $this->attributes;
        if ($this->cssClasses) {
            $attributes['class'] = implode(' ', array_keys($this->cssClasses));
        }
        if ($this->styles) {
            $attributes['style'] = implode(';', $this->styles);
        }
        return $attributes;
    }
338961
public function attributes(): array
    {
        $attributes = [];

        if (!$this->isExternal() || $this->fileExists()) {
            $file = $this->folder() . $this->multimedia_file_refn;

            $attributes['__FILE_SIZE__'] = $this->fileSizeKB();

            $imgsize = getimagesize($file);
            if (is_array($imgsize) && !empty($imgsize['0'])) {
                $attributes['__IMAGE_SIZE__'] = I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1']));
            }
        }

        return $attributes;
    }
717710
public function getAttributeValueIds()
    {
        return array_keys((new CmsAttributeValueRelationQuery)
            ->join('cms_attribute_value')->on('cms_attribute_value_id')
            ->whereObject()->equals($this->_object)
            ->andFieldObjectId()->equals($this->_objectId)
            ->findPairs('cms_attribute_value.id', 'cms_attribute_value.id'));
    }
698951
public function attributesToArray()
    {
        if (!empty($this->json_columns)) {
            foreach ($this->json_columns as $column_name) {
                $this->attributes[$column_name] = (string) $this->json_values[$column_name];
            }
        }

        return parent::attributesToArray();
    }
673358
public function attributes()
    {
        return [
            $this->attributePrefix.'address' => (int) $this->address,
            $this->attributePrefix.'title'   => (int) $this->title,
        ];
    }