Get the values of all fields as an array.
@return array
513590
public function getDataAsArray()
    {
        $fields = $this->getFields();

        if (!$fields) {
            return [];
        }

        $result = [];

        foreach ($fields as $field) {
            //ignore non-fields
            if (!$field instanceof AbstractFormField) {
                continue;
            }

            // if a field is disabled, we will ignore the field and only set an empty string as value
            if ($field->isDisabled()) {
                if (!array_key_exists($field->getName(), $result)) {
                    $result[$field->getName()] = '';
                }
                continue;
            }


            if ($field instanceof CheckBox) {
                $result[$field->getName()] = $field->isChecked() ? $field->getValue() : '';
            } elseif ($field instanceof RadioButton) {
                // if the field is not checked...
                if (!$field->isChecked()) {
                    // there was no other field with the same name yet
                    if (!array_key_exists($field->getName(), $result)) {
                        // then set the field with an empty value
                        $result[$field->getName()] = '';
                    }
                } // the field is checked
                else {
                    $result[$field->getName()] = $field->getValue();
                }
            } elseif ($field instanceof UploadField) {
                $value = $field->getValue();
                if (!$value ||
                    !isset($value['error']) ||
                    $value['error'] == UPLOAD_ERR_NO_FILE ||
                    empty($value['name'])
                ) {
                    continue;
                }
                $result[$field->getName()] = $value['name'];
            } elseif ($field instanceof AbstractFormField) {
                $result[$field->getName()] = $field->getValue();
            }
        }
        return $result;
    }
915930
protected function getFieldsValues(): array
    {
        $values = [];
        foreach ($this as $propName => $propValue) {
            if ($this->hasColumn($propName) && ! self::isInPrimaryKey($propName)) {
                $values[$propName] = $propValue;
            }
        }

        return $values;
    }
467559
public function toArray(): array
    {
        return array_filter([
            'field' => 'uuid.type' === $this->field
                ? null
                : $this->field,
            'values' => $this->values,
            'application_type' => self::AT_LEAST_ONE === $this->applicationType
                ? null
                : $this->applicationType,
            'filter_type' => self::TYPE_FIELD === $this->filterType
                ? null
                : $this->filterType,
            'filter_terms' => $this->filterTerms,
        ], function ($element) {
            return
            !(
                is_null($element) ||
                (is_array($element) && empty($element))
            );
        });
    }
1343933
public function getFields()
    {
        $fields = $this->getInput('fields');

        if (! is_array($fields)) {
            return [];
        }

        return array_map(function ($fields) {
            return explode(',', $fields);
        }, $fields);
    }
178204
protected static function getAllFields()
    {
        return FieldsValues::construct(
            [
                self::FIELD_UNIQUE_ID,
                self::FIELD_USERNAME,
                self::FIELD_FIRST_NAME,
                self::FIELD_LAST_NAME,
                self::FIELD_FULL_NAME,
                self::FIELD_EMAIL,
                self::FIELD_DESCRIPTION,
                self::FIELD_LOCATION,
                self::FIELD_PROFILE_URL,
                self::FIELD_IMAGE_URL,
                self::FIELD_WEBSITES,
                self::FIELD_VERIFIED_EMAIL,
                self::FIELD_EXTRA
            ]
        );
    }
683296
public function toArray()
    {
        $array = [];

        $array['alias']    = $this->getAlias();
        $array['property'] = $this->getProperty();
        $array['field']    = $this->getField();

        if (!empty($this->getType())) {
            $array['type'] = $this->getType();
        }

        $array['behavior'] = $this->getBehavior()->toArray();

        if (!empty($this->getFormat())) {
            $format = [];
            foreach ($this->getFormat() as $item) {
                $format[] = $item->toArray();
            }
            $array['format'] = $format;
        }

        if (!empty($this->getAllowedValues())) {
            $array['allowedValues'] = $this->getAllowedValues();
        }

        if (!empty($this->getComposition())) {
            $array['composition'] = $this->getComposition()->toArray();
        }

        if (!empty($this->getDefault())) {
            $array['default'] = $this->getDefault();
        }

        return $array;
    }
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
558734
public function toArray()
    {
        return array(
            static::FIELD_NAME                    => $this->_name,
            static::FIELD_STREET_ADDRESS          => $this->_streetAddress,
            static::FIELD_STREET_ADDRESS_ADDITION => $this->_streetAddressAddition,
            static::FIELD_CITY                    => $this->_city,
            static::FIELD_POSTAL_CODE             => $this->_postalCode,
            static::FIELD_COUNTRY                 => $this->_country,
            static::FIELD_STATE                   => $this->_state,
            static::FIELD_PHONE                   => $this->_phone,
        );
    }
220876
public function toArray()
    {
        $content = [
            'id' => $this->content->id,
            '_content' => $this->content->toArray(),
            '_revision' => $this->revision->toArray(),
        ];

        foreach ($this->data as $field => $data) {
            $content[$field] = $data->toArray();
        }

        return $content;
    }
1103932
public function toArray()
    {
        return array(
            static::FIELD_NAME => $this->_name,
            static::FIELD_DESCRIPTION => $this->_description,
            static::FIELD_ITEM_NUMBER => $this->_itemNumber,
            static::FIELD_AMOUNT => $this->_amount,
            static::FIELD_QUANTITY => $this->_quantity,
            static::FIELD_URL => $this->_url,
        );
    }
407045
public function toArray()
    {
        $array = parent::toArray();

        // Typecast every known field with it's respective data-type.
        // Integer, float and boolean fields may vary accourding to the
        // database engine
        if (isset($this->schema['attributes'])) {
            foreach($this->schema['attributes'] as $attribute) {
                @settype($array[$attribute['name']], $attribute['type']);
            }
        }

        $observer = static::getObserver($this->getTable());
        if ($observer) {
            if (method_exists($observer, 'toArray')) {
                return $observer->toArray($this, $array);
            }
        }

        return $array;
    }
1056279
public function toArray()
    {

        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[$name] = $this->getOriginalAttribute($name);
        }

        foreach ($this->appends as $name) {
            $attributes[$name] = $this->getAppendsAttribute($name);
        }

        return $attributes;
    }
1222475
public function toArray()
    {
        $out = [];
        foreach ($this as $key => $value) {
            $getter = sprintf('get%s', $key);
            if (!is_object($value) && method_exists($this, $getter)) {
                $out[$key] = call_user_func([$this, $getter]);
            }
        }

        return $out;
    }
446273
public function toArray()
    {
        $array = [
            "type"   => $this->getType(),
            "source" => $this->getSource()->toArray(),
        ];

        if (!empty($this->getSharedFields())) {
            $array['sharedFields'] = $this->getSharedFields();
        }

        if (!empty($this->getCommonFields())) {
            $array['commonFields'] = $this->getCommonFields();
        }

        return $array;
    }
306728
public function getFieldTypes()
    {
        $fields = [];
        foreach ($this->fields as $name => $value) {
            $fields[$name] = isset($this->types[$name])
                ? $this->types[$name]
                : null
                ;
        }

        return $fields;
    }
1136891
public function __toArray()
    {
        $result = array();
        $idx = 0;
        foreach ($this->var as $idx => $line) {
            $result[] = $line->__toFields();
        }
        return $result;
    }
1038304
public function toArray()
    {
        $data = parent::toArray();

        $data = array_intersect_key($data, $this->_fields);

        return $data;
    }