2022-06-27 15:55:35 +02:00
|
|
|
<?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());
|
|
|
|
}
|
|
|
|
|
2022-06-27 15:55:35 +02:00
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function chunkCount() : int
|
|
|
|
{
|
2022-07-11 15:06:18 +02:00
|
|
|
return $this->getSmsLength()->getMessageCount();
|
2022-06-27 15:55:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function length() : int
|
|
|
|
{
|
2022-07-11 15:06:18 +02:00
|
|
|
return $this->getSmsLength()->getSize();
|
2022-06-27 15:55:35 +02:00
|
|
|
}
|
|
|
|
|
2022-07-11 15:06:18 +02:00
|
|
|
public function getMessageContent()
|
2022-06-27 15:55:35 +02:00
|
|
|
{
|
2022-07-11 15:06:18 +02:00
|
|
|
return $this->get();
|
2022-06-27 15:55:35 +02:00
|
|
|
}
|
|
|
|
}
|