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 \DateTime |
||
25 | */ |
||
26 | public $time; |
||
27 | |||
28 | /** |
||
29 | * Timezone of sending a message. |
||
30 | * |
||
31 | * @var \DateTimeZone |
||
32 | */ |
||
33 | public $tz; |
||
34 | |||
35 | /** |
||
36 | * Create a new message instance. |
||
37 | * |
||
38 | * @param string $content |
||
39 | * |
||
40 | * @return static |
||
41 | */ |
||
42 | public static function create($content = '') |
||
43 | { |
||
44 | return new static($content); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param string $content |
||
49 | */ |
||
50 | public function __construct($content = '') |
||
51 | { |
||
52 | $this->content = $content; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Set the message content. |
||
57 | * |
||
58 | * @param string $content |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function content($content) |
||
68 | |||
69 | /** |
||
70 | * Set the phone number or sender name the message should be sent from. |
||
71 | * |
||
72 | * @param string $from |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function from($from) |
||
82 | |||
83 | /** |
||
84 | * Set the time the message should be sent. |
||
85 | * |
||
86 | * @param \DateTime|null $time |
||
87 | * |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function timestamp(\DateTime $time = null) |
||
96 | |||
97 | /** |
||
98 | * Set the timezone the message should be sent. |
||
99 | * |
||
100 | * @param \DateTimeZone $tz |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function timezone(\DateTimeZone $tz = null) |
||
110 | } |
||
111 |