From 54486d40089962822ed3ab5ec12139543f9ad1c4 Mon Sep 17 00:00:00 2001 From: Alex Komarichev Date: Tue, 2 Jul 2024 15:30:36 +0300 Subject: [PATCH] Add template attachments --- .../Entity/Template/TemplateAttachment.php | 74 +++++++++++++++++++ .../Entity/Template/TemplateVariables.php | 32 ++++++++ 2 files changed, 106 insertions(+) create mode 100644 src/Bot/Model/Entity/Template/TemplateAttachment.php diff --git a/src/Bot/Model/Entity/Template/TemplateAttachment.php b/src/Bot/Model/Entity/Template/TemplateAttachment.php new file mode 100644 index 0000000..e96fd24 --- /dev/null +++ b/src/Bot/Model/Entity/Template/TemplateAttachment.php @@ -0,0 +1,74 @@ +id; + } + + /** + * @param string $id + * @return void + */ + public function setId(string $id): void + { + $this->id = $id; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $caption + */ + public function setCaption(string $caption): void + { + $this->caption = $caption; + } +} diff --git a/src/Bot/Model/Entity/Template/TemplateVariables.php b/src/Bot/Model/Entity/Template/TemplateVariables.php index 1c2ffeb..908a5e0 100644 --- a/src/Bot/Model/Entity/Template/TemplateVariables.php +++ b/src/Bot/Model/Entity/Template/TemplateVariables.php @@ -1,5 +1,13 @@ $attachments + * + * @Type("array") + * @Accessor(getter="getAttachments",setter="setAttachments") + */ + private $attachments; + /** * @var array $body * @@ -85,4 +101,20 @@ public function setButtons(array $buttons): void { $this->buttons = $buttons; } + + /** + * @return TemplateAttachment[]|null + */ + public function getAttachments(): ?array + { + return $this->attachments; + } + + /** + * @param TemplateAttachment[] $attachments + */ + public function setAttachments(array $attachments): void + { + $this->attachments = $attachments; + } }