2022-06-27 15:55:35 +02:00
|
|
|
<?php
|
|
|
|
|
2022-07-13 10:50:45 +02:00
|
|
|
/**
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*
|
|
|
|
* https://www.d3data.de
|
|
|
|
*
|
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
|
|
|
* @link https://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
2022-06-27 15:55:35 +02:00
|
|
|
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
|
|
|
|
*/
|
2022-07-13 10:41:23 +02:00
|
|
|
public function chunkCount(): int
|
2022-06-27 15:55:35 +02:00
|
|
|
{
|
2022-07-11 15:06:18 +02:00
|
|
|
return $this->getSmsLength()->getMessageCount();
|
2022-06-27 15:55:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
2022-07-13 10:41:23 +02:00
|
|
|
public function length(): int
|
2022-06-27 15:55:35 +02:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
}
|