linkmobility-php-client/src/ValueObject/SmsMessageAbstract.php

40 lines
707 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace D3\LinkmobilityClient\ValueObject;
use Phlib\SmsLength\SmsLength;
abstract class SmsMessageAbstract extends StringValueObject implements SmsMessageInterface
{
2022-07-11 15:06:18 +02:00
/**
* @return SmsLength
*/
public function getSmsLength(): SmsLength
{
return new SmsLength($this->get());
}
/**
* @return int
*/
public function chunkCount() : int
{
2022-07-11 15:06:18 +02:00
return $this->getSmsLength()->getMessageCount();
}
/**
* @return int
*/
public function length() : int
{
2022-07-11 15:06:18 +02:00
return $this->getSmsLength()->getSize();
}
2022-07-11 15:06:18 +02:00
public function getMessageContent()
{
2022-07-11 15:06:18 +02:00
return $this->get();
}
}