Add template attachments
This commit is contained in:
commit
26aa42ce67
74
src/Bot/Model/Entity/Template/TemplateAttachment.php
Normal file
74
src/Bot/Model/Entity/Template/TemplateAttachment.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TemplateAttachment entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* TemplateAttachment class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
class TemplateAttachment implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $id
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $caption
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCaption",setter="setCaption")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $caption;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->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;
|
||||
}
|
||||
}
|
@ -1,5 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TemplateVariables entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
@ -22,6 +30,14 @@ class TemplateVariables implements ModelInterface
|
||||
*/
|
||||
private $header;
|
||||
|
||||
|
||||
/** @var array<TemplateAttachment> $attachments
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getAttachments",setter="setAttachments")
|
||||
*/
|
||||
private $attachments;
|
||||
|
||||
/**
|
||||
* @var array<string, string> $body
|
||||
*
|
||||
@ -85,4 +101,20 @@ class TemplateVariables implements ModelInterface
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user