Skip to content

Commit

Permalink
Merge pull request #538 from iIronside/fix-header
Browse files Browse the repository at this point in the history
Fix. Add header to TemplateModel
  • Loading branch information
bessudnov authored Dec 11, 2023
2 parents 9818fc3 + 37d218c commit 6fad456
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/AmoCRM/Models/Chats/Templates/TemplateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class TemplateModel extends BaseApiModel implements HasIdInterface
/** @var string|null */
protected $wabaLanguage = null;

/** @var string|null */
protected $wabaHeader = null;

/** @var string|null */
protected $wabaFooter = null;

Expand Down Expand Up @@ -155,6 +158,10 @@ public static function fromArray(array $template): TemplateModel
$model->setType($template['type']);
}

if (isset($template['waba_header'])) {
$model->setWabaHeader($template['waba_header']);
}

if (isset($template['waba_footer'])) {
$model->setWabaFooter($template['waba_footer']);
}
Expand Down Expand Up @@ -196,6 +203,7 @@ public function toArray(): array
'external_id' => $this->getExternalId(),
'request_id' => $this->getRequestId(),
'type' => $this->getType(),
'waba_header' => $this->getWabaHeader(),
'waba_footer' => $this->getWabaFooter(),
'waba_category' => $this->getWabaCategory(),
'waba_language' => $this->getWabaLanguage(),
Expand Down Expand Up @@ -225,6 +233,10 @@ public function toApi(?string $requestId = "0"): array
'type' => $this->getType(),
];

if ($this->getWabaHeader()) {
$result['waba_header'] = $this->getWabaHeader();
}

if ($this->getWabaFooter()) {
$result['waba_footer'] = $this->getWabaFooter();
}
Expand Down Expand Up @@ -468,6 +480,16 @@ public function setWabaLanguage(?string $wabaLanguage): TemplateModel
return $this;
}

/**
* @param string|null $wabaHeader
* @return TemplateModel
*/
public function setWabaHeader(?string $wabaHeader): TemplateModel
{
$this->wabaHeader = $wabaHeader;
return $this;
}

/**
* @param string|null $wabaFooter
* @return TemplateModel
Expand Down Expand Up @@ -522,6 +544,14 @@ public function getWabaLanguage(): ?string
return $this->wabaLanguage;
}

/**
* @return string|null
*/
public function getWabaHeader(): ?string
{
return $this->wabaHeader;
}

/**
* @return string|null
*/
Expand Down

0 comments on commit 6fad456

Please sign in to comment.