Converts the model's data to an array before it's saved to a YAML file.
@return array
960281
protected function modelToYamlArray()
    {
        $fileColumns = [];

        foreach ($this->columns as $column) {
            if (!isset($column['field'])) {
                throw new ApplicationException('Cannot save the list - the column field name should not be empty.');
            }

            $columnName = $column['field'];
            unset($column['field']);

            if (array_key_exists('id', $column)) {
                unset($column['id']);
            }

            $column = $this->preprocessColumnDataBeforeSave($column);

            $fileColumns[$columnName]  = $column;
        }

        return [
            'columns'=>$fileColumns
        ];
    }
427522
public function toArray()
    {
        return [
            'name' => $this->getName(),
            'text' => $this->getText(),
            'style' => $this->getStyle(),
            'type' => $this->getType(),
            'value' => $this->getValue(),
            'confirm' => $this->getConfirm()->toArray(),
        ];
    }
971067
public function toArray(): array
    {
        $data = $this->resourceToArray();

        if ($this->hasMetadata()) {
            $data['meta'] = $this->getMetadata();
        }

        return $data;
    }
60344
public function toArray()
    {
        $this->init();
        $values = [];
        foreach (array_keys($this->structureMetadata->getProperties()) as $childName) {
            $values[$childName] = $this->normalize($this->getProperty($childName)->getValue());
        }

        return $values;
    }
1210128
public function toArray()
    {
        return [
            'path'             => $this->getPath(),
            'assetsPath'       => $this->getAssetsPath(),
            'assetsPublicPath' => $this->getAssetsPublicPath(),
            'publishPath'      => $this->getPublishPath(),
            'localePath'       => $this->getLocalePath(),
            'viewsPath'        => $this->getViewsPath(),
            'configPath'       => $this->getConfigPath(),
            'routesPath'       => $this->getRoutesPath(),
            'namespace'        => $this->getNamespace(),
            'name'             => $this->getName(),
        ];
    }
244452
public function toArray()
    {
        $data = [];

        $storages = $this->preloadAllStorages();

        foreach ($storages as $url=>$storage) {

            $prefix = $this->keyPrefix($url);

            $data[$prefix] = $storage->toArray();

        }

        return $data;
    }
1161453
public function toArray()
    {
        $attr = !empty($this->getWarden()) ? $this->getWarden() : null;
        if (empty($attr)) {
            $attr = empty($this->getVisible()) ? $this->getFillable() : $this->getVisible();
        }
        $returnable = [];

        $f_model = \FormModel::using('plain')->withModel($this);
        foreach ($attr as $old => $new) {
            if (!empty($relations = $f_model->getRelationalDataAndModels($this, $old))) {
                $returnable[$new] = $relations;
            }
            if (stripos($old, '_id') !== false) {
                if (!empty($this->$new)) {
                    $returnable[$new] = $relations;
                }
            } else {
                if (isset($this->$old)) {
                    $returnable[$new] = $this->$old;
                }
            }
        }

        return $returnable;
    }
1374225
public function toArray()
    {
        return array_filter(
            array(
                'method' => $this->getMethod(),
                'url' => $this->getUrl(),
                'headers' => $this->getHeaders(),
                'body' => $this->getBody(),
                'post_files' => $this->getPostFiles(),
                'post_fields' => $this->getPostFields(),
            )
        );
    }
501842
public function toArray()
    {
        $data = $this->_data;
        $data['message'] = $this->getMessage();
        $data['code'] = $this->getCode();
        $data['key'] = $this->getkey();
        $data = array_reverse($data);

        return $data;
    }
998926
public function toArray()
    {
        $data = array(
            'added' => $this->getAdded(true),
            'api' => $this->getApi(),
            'cwd' => $this->getCwd(true),
            'debug' => $this->getDebug(),
            'files' => $this->getFiles(true),
            'list' => $this->getList(),
            'netDrivers' => $this->getNetDrivers(),
            'options' => $this->getOptions(),
            'removed' => $this->getRemoved(true),
            'tree' => $this->getTree(true),
            'uplMaxSize' => $this->getUplMaxSize(),
            'content' => $this->getContent(),
            'size' => $this->getSize(),
            'error' => $this->getError(),
            'dim' => $this->getDim(),
        );

        return array_filter(
            $data,
            function ($var) {
                return !is_null($var);
            }
        );
    }
1178694
public function toArray(): array
    {
        $data = [
            'meta'     => $this->getMetadata(),
            'links'    => $this->linksToArray(),
            'errors'   => $this->errorsToArray(),
            'included' => $this->includedResourcesToArray()
        ];

        $data = array_filter($data, 'count');

        if ($this->jsonApi !== null) {
            $data['jsonapi'] = $this->jsonApi->toArray();
        }

        return $data;
    }
511545
public function toArray()
    {
        return array(
            'id' => $this->getId(),
            'title' => $this->getTitle(),
            'class' => $this->getClass(),
            'iconCls' => $this->getIconClass(),
            'data' => $this->getData(),
            'settings' => $this->getSettings(),
        );
    }
695109
public function toArray()
    {
        return [
            'name'        => $this->name,
            'title'       => $this->title,
            'url'         => $this->url,
            'icon'        => $this->icon,
            'active'      => $this->isActive(),
            'children'    => $this->children->toArray(),
            'roles'       => $this->roles,
            'permissions' => $this->permissions,
        ];
    }
1290446
public function toArray()
	{
		$error = array(
			'code'    => $this->getCode(),
			'message' => $this->getMessage(),
		);

		if ($this->getData()) {
			$error['data'] = $this->getData();
		}

		return $error;
	}
1321011
public function toArray()
    {
        return [
            'name' => $this->name,
            'labels' => $this->labelsToRaw($this->getLabels()),
            'html-type' => $this->htmlType,
            'css-class' => $this->cssClass,
            'options' => $this->optionsToRaw($this->getOptions()),
            'html-value' => $this->htmlValue,
            'validation' => implode('|', $this->validationRules),
            'is-on-index' => $this->isOnIndexView,
            'is-on-show' => $this->isOnShowView,
            'is-on-form' => $this->isOnFormView,
            'data-type' => $this->getRawDataType(),
            'data-type-params' => $this->methodParams,
            'data-value' => $this->dataValue,
            'is-index' => $this->isIndex,
            'is-unique' => $this->isUnique,
            'is-primary' => $this->isPrimary,
            'comment' => $this->comment,
            'is-nullable' => $this->isNullable(),
            'is-header' => $this->isHeader,
            'is-unsigned' => $this->isUnsigned,
            'is-auto-increment' => $this->isAutoIncrement,
            'is-inline-options' => $this->isInlineOptions,
            'is-date' => $this->isDate,
            'date-format' => $this->dateFormat,
            'cast-as' => $this->castAs,
            'placeholder' => $this->labelsToRaw($this->getPlaceholders()),
            'delimiter' => $this->optionsDelimiter,
            'range' => $this->range,
            'foreign-relation' => $this->getForeignRelationToRaw(),
            'foreign-constraint' => $this->getForeignConstraintToRaw(),
            'on-store' => $this->onStore,
            'on-update' => $this->onUpdate,
        ];
    }
328655
public function toArray(): array
    {
        return [
            'name' => $this->name,
            'method' => $this->method,
            'url' => $this->url,
            'model' => $this->model,
            'view' => $this->view,
            'controller' => $this->controller,
            'action' => $this->action,
            'default' => $this->default,
            'param' => $this->param,
            'callback' => $this->callback
        ];
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }