Get the array representation of this attachment action.

@return array
963322
public function toArray(): array
    {
        return [
            'name' => $this->name,
            'text' => $this->text,
            'style' => $this->style,
            'type' => $this->type,
            'value' => $this->value,
            'confirm' => $this->confirm ? $this->confirm->toArray() : null,
        ];
    }
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(),
                )
            );
        }
1358016
public function actionImages(): Response
    {
        $result = [];

        foreach (AttachmentModel::find()->each() as $attachment) {
            $result[] = [
                'id' => $attachment->id,
                'url' => $attachment->getFileUrl('origin'),
                'thumb' => $attachment->getFileUrl('thumbnail'),
            ];
        }

        return $this->asJson($result);
    }
301998
protected function getAttachments()
    {
        $attachments = array();
        foreach ($this->getSections(self::SECTION_ATTACHMENTS) as $section) {
            $obj = $this->getSection($section);
            $attachment = new IncomingMessageAttachment($obj);
            $objNew = new \stdClass();
            $objNew->name = $attachment->name;
            $objNew->body = $attachment->body;
            $objNew->info = $obj;
            $attachments[] = $objNew;
        }
        $this->attachments = $attachments;
    }
532119
public function toArray() {
        $arr              = parent::toArray();
        $arr['json']      = $this->json;
        $arr['file_name'] = $this->fileName;
        $arr['file_path'] = $this->path;
        return $arr;
    }
6056
public function toArray()
    {
        return [
            'fallback'    => $this->fallback,
            'text'        => $this->text,
            'pretext'     => $this->preText,
            'color'       => $this->color,
            'footer'      => $this->footer,
            'mrkdwn_in'   => $this->useMarkdown ? ['text', 'pretext', 'footer'] : [],
            'footer_icon' => $this->footerIcon,
            'ts'          => $this->timestamp ? $this->timestamp->getTimestamp() : null,
            'image_url'   => $this->imageUrl,
            'thumb_url'   => $this->thumbUrl,
            'title'       => $this->title,
            'title_link'  => $this->titleLink,
            'author_name' => $this->authorName,
            'author_link' => $this->authorLink,
            'author_icon' => $this->authorIcon,
            'callback_id' => $this->callbackId,
            'fields'      => $this->fields->map(function (AttachmentField $field) {
                return $field->toArray();
            })->toArray(),
            'actions'     => $this->actions->map(function (AttachmentAction $action) {
                return $action->toArray();
            })->toArray(),
        ];
    }
23882
public function asArray()
    {
        return [
            'id'        => $this->getId(),
            'className' => $this->getClassName(),
            'instance'  => $this->getInstance(),
            'arguments' => $this->getArguments(),
            'type'      => $this->getType(),
            'target'    => $this->getTarget(),
            'position'  => $this->getPosition(),
        ];
    }
867639
public function toArray()
    {
        return [
            'userAgent'    => $this->userAgent,
            'version'      => $this->version,
            'majorVersion' => $this->majorVersion,
            'minorVersion' => $this->minorVersion,
            'patchVersion' => $this->patchVersion,
            'debug'        => $this->debug,
            'platform'     => $this->platform,
            'device'       => $this->device,
        ];
    }
1144657
public function attachmentsAsRows()
    {
        $rows = [];

        if ($this->hasAttachments()) {
            $rows = array_chunk($this->attachments()->values(), $this->numColumns);

            /** Map row content with useful front-end properties. */
            array_walk($rows, function(&$value, $key) {
                $value = [
                    'columns' => $value,
                    'isFirst' => $key === 0
                ];
            });
        }

        return $rows;
    }
479351
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->family)) {
            $result['family'] = $this->family->toArray();
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->edition)) {
            $result['edition'] = $this->edition;
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
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,
        ];
    }
317656
public function getAttachments()
    {
        /** @noinspection IsEmptyFunctionUsageInspection */
        /** @noinspection PhpUndefinedMethodInspection */
        if (!empty(parent::getAttachments())) {
            /** @noinspection PhpUndefinedMethodInspection */
            return parent::getAttachments();
        }

        $attachments = $this->_storage->getAttachments($this);

        /** @noinspection PhpUndefinedMethodInspection */
        $this->setAttachments($attachments);

        return $attachments;
    }
15790
public function toArray()
	{
		return array(
			'type' 			=> self::TYPE_ID,
			'id' 			=> $this->imageId,
			'align' 		=> $this->align,
			'style' 		=> $this->style,

			'alternate_text'	=> $this->alternateText,
			'title' 		=> $this->title,
			'description' 	=> $this->description,

			'size_width' 	=> $this->width,
			'size_height' 	=> $this->height,
			'crop_top' 		=> $this->cropTop,
			'crop_left' 	=> $this->cropLeft,
			'crop_width' 	=> $this->cropWidth,
			'crop_height' 	=> $this->cropHeight,

			'size_name' 	=> $this->sizeName,
		);
	}
112930
public function toArray()
    {
        $data = [
            'fallback' => $this->getFallback(),
            'text' => $this->getText(),
            'pretext' => $this->getPretext(),
            'color' => $this->getColor(),
            'footer' => $this->getFooter(),
            'footer_icon' => $this->getFooterIcon(),
            'ts' => $this->getTimestamp() ? $this->getTimestamp()->getTimestamp() : null,
            'mrkdwn_in' => $this->getMarkdownFields(),
            'image_url' => $this->getImageUrl(),
            'thumb_url' => $this->getThumbUrl(),
            'title' => $this->getTitle(),
            'title_link' => $this->getTitleLink(),
            'author_name' => $this->getAuthorName(),
            'author_link' => $this->getAuthorLink(),
            'author_icon' => $this->getAuthorIcon(),
        ];

        $data['fields'] = $this->getFieldsAsArrays();
        $data['actions'] = $this->getActionsAsArrays();

        return $data;
    }
1110096
public function getData()
    {

        $result = [
            'attachment' => [
                'type' => 'template',
                'payload' => [
                    'template_type' => $this->type
                ]
            ]
        ];

        if (is_array($this->quick_replies)) {
            foreach ($this->quick_replies as $qr) {
                if ($qr instanceof QuickReplyButton) {
                    $result['quick_replies'][] = $qr->getData();
                }
            }
        }

        switch ($this->type)
        {
            case self::TYPE_BUTTON:
                $result['attachment']['payload']['text'] = $this->title;
                $result['attachment']['payload']['buttons'] = [];

                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }

            break;

            case self::TYPE_GENERIC:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['image_aspect_ratio'] = $this->image_aspect_ratio;

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
            break;

            case self::TYPE_LIST:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['top_element_style'] = $this->top_element_style;
                //list items button
                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
                //the whole list button
                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }
            break;

            case self::TYPE_RECEIPT:
                $result['attachment']['payload']['recipient_name'] = $this->recipient_name;
                $result['attachment']['payload']['order_number'] = $this->order_number;
                $result['attachment']['payload']['currency'] = $this->currency;
                $result['attachment']['payload']['payment_method'] = $this->payment_method;
                $result['attachment']['payload']['order_url'] = $this->order_url;
                $result['attachment']['payload']['timestamp'] = $this->timestamp;
                $result['attachment']['payload']['elements'] = [];

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }

                $result['attachment']['payload']['address'] = $this->address->getData();
                $result['attachment']['payload']['summary'] = $this->summary->getData();
                $result['attachment']['payload']['adjustments'] = [];

                foreach ($this->adjustments as $btn) {
                    $result['attachment']['payload']['adjustments'][] = $btn->getData();
                }
            break;
        }


        if ($this->recipient) {
            return [
                'recipient' =>  [
                    'id' => $this->recipient
                ],
                'message' => $result,
                'tag' => $this->tag,
                'notification_type'=> $this->notification_type,
                'messaging_type' => $this->messaging_type
            ];
        } else {
            //share_contents only
            return [
                'attachment' => $result['attachment']
            ];
        }
    }
791079
public function toArray()
    {
        return [
            'severity' => $this->severity,
            'msg' => $this->msg,
            'hint' => $this->hint,
            'link' => !empty($this->link) ? $this->link : null,
            'iconCls' => $this->iconClass,
        ];
    }
1231663
public function toArray(): array
    {
        return [
            'scheme'    => $this->scheme,
            'authority' => $this->authority,
            'path'      => $this->path,
            'query'     => $this->query,
            'fragment'  => $this->fragment
        ];
    }