Return an array representation of the object

Useful for turning the array of entities into a nested array,
which is then ready to be JSON encoded in a REST response.

@return array
11300
public function getArrayCopy()
    {
        $results = array_map(function ($entity) {
            return $entity->getArrayCopy();
        }, $this->entities);

        if (! $this->paginationData) {
            return $results;
        } else {
            $data = $this->paginationData->getArrayCopy();
            $data['results'] = $results;
            return $data;
        }
    }
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;
    }
785755
public function toArray()
    {
        $this->dataType('array');
        
        $this->execute();
        
        if ($this->def['savePath']) {
            return $this->save();
        } elseif ($this->def['verbose']) {
            return $this->getVerboseResponse();
        }
        
        return $this->getError() ? : json_decode($this->responseText, true);
    }
1174793
public function toArray()
    {
        $data = [$this->_getBaseName() => $this->getParams()];

        if (!empty($this->_rawParams)) {
            $data = \array_merge($data, $this->_rawParams);
        }

        return $this->_convertArrayable($data);
    }
1252108
public function jsonSerialize()
    {
        $out = [];
        foreach ($this as $model) {
            if (!is_object($model)) {
                continue;
            }
            if ($model instanceof JsonSerializable) {
                $out[] = $model->jsonSerialize();
            } else {
                $out[] = (object)(array)$model;
            }
        }
        return $out;
    }
1049971
public function getAllEntitiesToArray()
    {
        $entities = $this->getAll();
        $array = [];
        foreach ($entities as $entity) {
            $depth = isset($entity->depth) ? str_repeat('— ', $entity->depth) : '';
            $title = $entity->title ?? $entity->name;
            $array[$entity->id] = $depth . $title;
        }
        return $array;
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
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;
    }
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;
    }
710162
public function asArray()
    {
        $fields = [
            '@type' => $this->type(),
            '@key'  => $this->key(),
        ];

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

        return $fields;
    }
909912
public function toArray()
    {
        return [
            'type'     => get_class($this),
            'value'    => $this->getValue(),
            'children' => array_map(function ($node) {
                return $node->jsonSerialize();
            }, $this->getChildren()),
        ];
    }
164177
public function jsonSerialize()
    {
        $parameters = [];

        if ($this->accessToken) {
            $parameters['access_token'] = $this->accessToken;
        }

        if ($this->userId) {
            $parameters['user_id'] = $this->userId;
        }

        if ($this->entityId) {
            $parameters['entity_id'] = $this->entityId;
        }

        if ($this->expires) {
            $parameters['expires'] = $this->expires;
        }

        return $parameters;
    }
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
652278
public function toArray()
    {
        $headers = $this->headers;

        if ($headers === null) {
            $headers = [];
        }

        if ($this->contentType !== null) {
            $headers["content-type"] = $this->contentType;
        }

        if ($this->contentEncoding !== null) {
            $headers["content-encoding"] = $this->contentEncoding;
        }

        if ($this->deliveryMode !== null) {
            $headers["delivery-mode"] = $this->deliveryMode;
        }

        if ($this->priority !== null) {
            $headers["priority"] = $this->priority;
        }

        if ($this->correlationId !== null) {
            $headers["correlation-id"] = $this->correlationId;
        }

        if ($this->replyTo !== null) {
            $headers["reply-to"] = $this->replyTo;
        }

        if ($this->expiration !== null) {
            $headers["expiration"] = $this->expiration;
        }

        if ($this->messageId !== null) {
            $headers["message-id"] = $this->messageId;
        }

        if ($this->timestamp !== null) {
            $headers["timestamp"] = $this->timestamp;
        }

        if ($this->typeHeader !== null) {
            $headers["type"] = $this->typeHeader;
        }

        if ($this->userId !== null) {
            $headers["user-id"] = $this->userId;
        }

        if ($this->appId !== null) {
            $headers["app-id"] = $this->appId;
        }

        if ($this->clusterId !== null) {
            $headers["cluster-id"] = $this->clusterId;
        }

        return $headers;
    }
1043480
public function toArray()
    {
        return array_map(static function ($value) {
            if ($value instanceof ArraySerializableInterface) {
                $value = $value->toArray();
            }
            return $value;
        }, get_object_vars($this));
    }
914874
public function toJson()
    {
        $array = array();
        foreach ($this->disclose() as $key => $disclosure) {
            $values = $disclosure->toArray();
            foreach ($values as &$value) {
                $value = utf8_encode($value);
            }
            $array[$key] = $values;
        }
        return json_encode($array);
    }
497780
public function jsonSerialize()
    {
        $arr = parent::jsonSerialize();
        $vars = get_object_vars($this);
        return array_merge($vars, $arr);
    }