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

        foreach ($this->menus as $mainMenuItem) {
            $mainMenuItem = $this->trimMenuProperties($mainMenuItem);

            if (!isset($mainMenuItem['code'])) {
                throw new ApplicationException('Cannot save menus - the main menu item code should not be empty.');
            }

            if (isset($mainMenuItem['sideMenu'])) {
                $sideMenuItems = [];

                foreach ($mainMenuItem['sideMenu'] as $sideMenuItem) {
                    $sideMenuItem = $this->trimMenuProperties($sideMenuItem);

                    if (!isset($sideMenuItem['code'])) {
                        throw new ApplicationException('Cannot save menus - the side menu item code should not be empty.');
                    }

                    $code = $sideMenuItem['code'];
                    unset($sideMenuItem['code']);

                    $sideMenuItems[$code] = $sideMenuItem;
                }

                $mainMenuItem['sideMenu'] = $sideMenuItems;
            }

            $code = $mainMenuItem['code'];
            unset($mainMenuItem['code']);

            $fileMenus[$code] = $mainMenuItem;
        }

        return $fileMenus;
    }
618343
public function toArray()
    {
        return array(
            'name' => $this->_name,
            'type' => $this->_datatype,
            'length' => $this->_length,
            'notnull' => $this->_notnull,
            'default' => $this->_default,
            'autoincrement' => $this->_autoIncrement,
            'comment' => $this->_comment,
        );
    }
171058
public function toArray(): array
    {
        return [
            'uuid' => $this->uuid->toArray(),
            'app_id' => $this->appUUID->toArray(),
            'is_ok' => $this->isOK,
            'doc_count' => $this->docCount,
            'size' => $this->size,
            'shards' => $this->shards,
            'replicas' => $this->replicas,
            'fields' => $this->fields,
            'metadata' => $this->metadata,
        ];
    }
575776
public function &toArray()
    {
        if (!isset($this->__propertyToData[Schema::DEFAULT_MAPPING])) {
            return $this->__arrayOfData;
        }
        if (null === $this->__mappedProperties) {
            $properties = array();
            foreach ($this->__arrayOfData as $propertyName => $property) {
                if (isset($this->__propertyToData[Schema::DEFAULT_MAPPING][$propertyName])) {
                    $propertyName = $this->__propertyToData[Schema::DEFAULT_MAPPING][$propertyName];
                }
                $properties[$propertyName] = $property;
            }
            $this->__mappedProperties = $properties;
        }
        return $this->__mappedProperties;
    }
203825
public function toArray()
    {
        $data = parent::toArray();

        foreach ($this->getComputedProperties() as $property)
        {
            if ($this->{$property} instanceof ModelEntityInterface) {
                $data[$property] = array_values($this->{$property}->toArray());
            } else {
                $data[$property] = $this->{$property};
            }
        }

        foreach(array_keys($data) as $key)
        {
            if (substr($key, 0, 1) === '_') {
                unset($data[$key]);
            }
        }

        return $data;
    }
584026
public function toArray()
    {
        return [
            $this->id,
            $this->filterName,
            $this->operator,
            serialize($this->value),
        ];
    }
1340824
public function toArray()
    {
        return [
            'field' => $this->getRawProperty('field'),
            'from-field' => $this->getRawProperty('fromField'),
            'to-field' => $this->getRawProperty('toField'),
            'is-deleted' => $this->isDeleted,
            'is-added' => $this->isAdded,
        ];
    }
533407
final public function toArray()
    {
        $this->checkRequiredFields();

        $fields = get_object_vars($this);

        $array = [];
        foreach ($fields as $field => $value) {
            $array[$field] = $this->transformToArray($this->getAttribute($field));
        }

        return $array;
    }
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;
    }
196944
public function toArray()
    {
        return [
            'platform'        => $this->platform,
            'environment'     => $this->environment,
            'version'         => $this->version,
            'majorVersion'    => $this->majorVersion,
            'minorVersion'    => $this->minorVersion,
            'patchVersion'    => $this->patchVersion,
            'deviceOsVersion' => $this->deviceOsVersion,
            'device'          => $this->device,
        ];
    }
281560
public function toArray()
    {
        $data = [
            'name' => $this->name,
            'type' => $this->type,
            'description' => $this->description
        ];

        if (null !== $this->child) {
            $data['properties'] = [];

            foreach ($this->child as $child) {
                $data['properties'][$child->getName()] = $child->toArray();
            }
        }

        return $data;
    }
244452
public function toArray()
    {
        $data = [];

        $storages = $this->preloadAllStorages();

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

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

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

        }

        return $data;
    }
563102
public function toArray(): array
    {
        $data = [
            'meta'          => $this->getMetadata(),
            'links'         => $this->linksToArray(),
            'attributes'    => $this->getAttributes(),
            'relationships' => $this->relationshipsToArray()
        ];

        return array_merge(
            $this->resourceToArray(),
            array_filter($data, 'count')
        );
    }
115424
public function toArray(): array
    {
        $data = array_filter([
            'id'     => $this->id,
            'status' => $this->status,
            'code'   => $this->code,
            'title'  => $this->title,
            'detail' => $this->detail
        ]);

        if ($this->hasLinks()) {
            $data['links'] = $this->linksToArray();
        }

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

        return $data;
    }
1345106
public function toArray()
    {
        $schema = array(
            'name' => $this->_name,
            'label' => $this->_label,
            'description' => $this->_description,
            'type' => $this->_type,
            'store' => $this->_isStored,
            'index' => $this->_isIndexd,
            'multivalue' => $this->_isMultiValued,
        );

        if (isset($this->_size)) {
            $schema['size'] = $this->_size;
        }

        return $schema;
    }
968795
public function toArray()
    {
        $data = array();
        $map = array(
            'id' => 'getId',
            'name' => 'getName',
            'source_type' => 'getSourceType',
            'status' => 'getStatus',
            'parameters' => 'getParameters',
            'auth' => 'getAuth',
            'resources' => 'getResources',
            'created_at' => 'getCreatedAt',
            'validate' => 'getValidate'
        );

        foreach ($map as $key => $getter) {
            $data[$key] = $this->$getter();
        }

        foreach (array('auth', 'resources', 'parameters') as $key) {
            if (isset($data[$key])) {
                $data[$key] = json_encode($data[$key]);
            }
        }

        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(),
        );
    }