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

51 lines
1.0 KiB
PHP
Raw Normal View History

<?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
*/
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
*/
2022-07-13 10:41:23 +02:00
public function chunkCount(): int
{
2022-07-11 15:06:18 +02:00
return $this->getSmsLength()->getMessageCount();
}
/**
* @return int
*/
2022-07-13 10:41:23 +02:00
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();
}
}