| 1 | <?php |
||
| 5 | class SmscRuMessage |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The phone number the message should be sent from. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | public $from = ''; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The message content. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $content = ''; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Time of sending a message. |
||
| 23 | * |
||
| 24 | * @var \DateTimeInterface |
||
| 25 | */ |
||
| 26 | public $sendAt; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create a new message instance. |
||
| 30 | * |
||
| 31 | * @param string $content |
||
| 32 | * |
||
| 33 | * @return static |
||
| 34 | */ |
||
| 35 | 4 | public static function create($content = '') |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $content |
||
| 42 | */ |
||
| 43 | 8 | public function __construct($content = '') |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Set the message content. |
||
| 50 | * |
||
| 51 | * @param string $content |
||
| 52 | * |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | 1 | public function content($content) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Set the phone number or sender name the message should be sent from. |
||
| 64 | * |
||
| 65 | * @param string $from |
||
| 66 | * |
||
| 67 | * @return $this |
||
| 68 | */ |
||
| 69 | 4 | public function from($from) |
|
| 75 | |||
| 76 | /** |
||
| 77 | * Set the time the message should be sent. |
||
| 78 | * |
||
| 79 | * @param \DateTimeInterface|null $sendAt |
||
| 80 | * |
||
| 81 | * @return $this |
||
| 82 | */ |
||
| 83 | 2 | public function sendAt(\DateTimeInterface $sendAt = null) |
|
| 89 | } |
||
| 90 |