%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/vonage/client-core/src/Messages/Channel/ |
Upload File : |
<?php
namespace Vonage\Messages\Channel;
abstract class BaseMessage implements Message
{
protected string $subType;
protected string $to;
protected string $from;
protected string $channel;
protected ?string $clientRef = null;
public const MESSAGES_SUBTYPE_TEXT = 'text';
public const MESSAGES_SUBTYPE_IMAGE = 'image';
public const MESSAGES_SUBTYPE_VCARD = 'vcard';
public const MESSAGES_SUBTYPE_AUDIO = 'audio';
public const MESSAGES_SUBTYPE_VIDEO = 'video';
public const MESSAGES_SUBTYPE_FILE = 'file';
public const MESSAGES_SUBTYPE_TEMPLATE = 'template';
public const MESSAGES_SUBTYPE_STICKER = 'sticker';
public const MESSAGES_SUBTYPE_CUSTOM = 'custom';
public function getClientRef(): ?string
{
return $this->clientRef;
}
public function setClientRef(string $clientRef): void
{
$this->clientRef = $clientRef;
}
public function getSubType(): string
{
return $this->subType;
}
public function getFrom(): string
{
return $this->from;
}
public function setFrom(string $from): void
{
$this->from = $from;
}
public function getChannel(): string
{
return $this->channel;
}
public function getTo(): string
{
return $this->to;
}
public function setTo(string $to): void
{
$this->to = $to;
}
public function getBaseMessageUniversalOutputArray(): array
{
$returnArray = [
'message_type' => $this->getSubType(),
'to' => $this->getTo(),
'from' => $this->getFrom(),
'channel' => $this->getChannel(),
];
if ($this->getClientRef()) {
$returnArray['client_ref'] = $this->getClientRef();
}
return $returnArray;
}
}