To array for send api
@return array
181224
public function toData()
    {
        if ($this->action === self::TYPE_READ) {
            return [
                'fields' => 'home_url',
            ];
        }

        if ($this->action === self::TYPE_DELETE) {
            return [
                'fields' => [
                    'home_url',
                ],
            ];
        }

        return [
            'home_url' => array_merge([
                'webview_height_ratio' => 'tall',
            ], $this->config),
        ];
    }
271996
public function send()
    {
        if (!$this->auth_code) {
            $this->getAuthCode();
        }

        return [
            'redirect'             => $this->redirect,
            'transactionReference' => $this->transactionReference,
            'auth_code'            => $this->auth_code,
        ];
    }
681890
public function toArray()
    {
        return array(
            'browser_name' => $this->getBrowserName(),
            'browser_version' => $this->getBrowserVersion(),
            'browser_engine' => $this->getBrowserEngine(),
            'operating_system' => $this->getOperatingSystem(),
            'device' => $this->getDevice()
        );
    }
812968
public function toArray()
    {
        $packet = $this->getPacket();

        return array(
            'id'           => (string)$this->id,
            'hostname'     => (string)$packet['hostname'],
            'pid'          => (int)$packet['pid'],

            'queues'       => array(
                'selected' => (array)explode(',', $packet['queues']),
                'resolved' => (array)$this->resolveQueues()
            ),
            'shutdown'     => (bool)$packet['shutdown'],
            'blocking'     => (bool)$packet['blocking'],
            'status'       => (int)$packet['status'],
            'interval'     => (int)$packet['interval'],
            'timeout'      => (int)$packet['timeout'],
            'memory'       => (int)$packet['memory'],
            'memory_limit' => (int)$packet['memory_limit'] * 1024 * 1024,

            'started'      => (float)$packet['started'],
            'processed'    => (int)$packet['processed'],
            'cancelled'    => (int)$packet['cancelled'],
            'failed'       => (int)$packet['failed'],

            'job_id'       => (string)$packet['job_id'],
            'job_pid'      => (int)$packet['job_pid'],
            'job_started'  => (float)$packet['job_started'],
        );
    }
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;
    }
537509
public function toArray()
	{
		return [
			'creator' => SerializationHelper::stringOrNull($this->creator),
			'metadata' => SerializationHelper::serialize($this->metadata),
			'waypoints' => SerializationHelper::serialize($this->waypoints),
			'routes' => SerializationHelper::serialize($this->routes),
			'tracks' => SerializationHelper::serialize($this->tracks),
			'extensions' => SerializationHelper::serialize($this->extensions)
		];
	}
593701
public function toArray()
    {
        return [
            'ref'             => $this->sRef,
            'state'           => $this->sState,
            'dated'           => $this->sDated,
            'terms'           => (int) $this->iTerms ?: null,
            'customer_id'     => (int) $this->iCustomerId ?: null,
            'email'           => $this->sEmail,
            'currency'        => $this->sCurrency,
            'additional_text' => $this->sAdditionalText,
            'callback_data'   => $this->mCallbackData,
            'items'           => (array) $this->aItems,
        ];
    }
1362045
public function toArray()
    {
        return [
            'folderId' => $this->folder->getId(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
1192003
public function toArray()
    {
        return [
            'required'      => $this->isRequired(),
            'hidden'        => $this->isHidden(),
            'persistent'    => $this->isPersistent(),
            'whenReplicate' => $this->getWhenReplicate()->toArray(),
            'whenPatch'     => $this->getWhenPatch()->toArray(),
        ];
    }
211490
public function toArray() {
		return [
			'key' => $this->key(),
			'url' => $this->url(),
			'formData' => $this->formData(),
			'cacheControl' => $this->cacheControl(),
			'expires' => $this->expires(),
			'acl' => $this->acl()
		];
	}
195503
public function toArray()
        {
            return array_merge(
                parent::toArray(),
                array(
                     'action'       => $this->getAction(),
                     'controller'   => $this->getController(),
                     'module'       => $this->getModule(),
                     'params'       => $this->getParams(),
                     'route'        => $this->getRoute(),
                     'reset_params' => $this->getResetParams(),
                     'encodeUrl'    => $this->getEncodeUrl(),
                     'scheme'       => $this->getScheme(),
                )
            );
        }
640600
public function toArray()
    {
        return array(
            'scheme' => $this->scheme->get(),
            'user' => $this->user->get(),
            'pass' => $this->pass->get(),
            'host' => $this->host->get(),
            'port' => $this->port->get(),
            'path' => $this->path->get(),
            'query' => $this->query->get(),
            'fragment' => $this->fragment->get(),
        );
    }
829360
public function jsonSerialize()
    {
        return array(
            'type' => $this->getType(),
            'bodyText' => $this->getBodyText(),
            'bodyHtml' => $this->getBodyHtml(),
            'recipients' => $this->getRecipients(),
            'from'    => $this->getFrom(),
            'subject' => $this->getSubject(),
            'text'    => quoted_printable_decode($this->getBodyText(true)),
            'html'    => quoted_printable_decode($this->getBodyHtml(true))
        );
    }
791079
public function toArray()
    {
        return [
            'severity' => $this->severity,
            'msg' => $this->msg,
            'hint' => $this->hint,
            'link' => !empty($this->link) ? $this->link : null,
            'iconCls' => $this->iconClass,
        ];
    }
170897
public function toArray()
    {
        return [
            'key'      => $this->key(),
            'name'     => $this->name(),
            'script'   => $this->script(),
            'dir'      => $this->direction(),
            'native'   => $this->native(),
            'regional' => $this->regional(),
        ];
    }
1260724
public function __toArray()
    {
        return array(
            'subject' => $this->getSubject(),
            'from' => $this->getFrom(),
            'to' => $this->getTo(),
            'createdat' => $this->getCreatedAt(),
            'in_reply_to' => $this->getInReplyTo() ? $this->getInReplyTo()->getMessageId() : null,
            'message_type' => (string)$this->getMessageType(),
            'body' => $this->getBody(),
        );
    }
1145401
public function toArray()
    {
        return [
            'openId'        => $this->openId,
            'unionId'       => $this->unionId,
            'nickName'      => $this->nickName,

            'sex'           => $this->sex->getValue(),
            'city'          => $this->city,
            'province'      => $this->province,
            'country'       => $this->country,
            'headImgUrl'    => $this->headImgUrl,

            'subscribe'     => $this->subscribe->getValue(),
            'subscribeTime' => $this->subscribeTime,
            'groupId'       => $this->groupId,
        ];
    }