forked from smsapi/smsapi-php-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScheduleSmsToGroupBag.php
More file actions
83 lines (69 loc) · 1.78 KB
/
ScheduleSmsToGroupBag.php
File metadata and controls
83 lines (69 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types=1);
namespace Smsapi\Client\Feature\Sms\Bag;
use DateTimeInterface;
/**
* @api
* @property string $from
* @property string $message
* @property string $template
* @property string $encoding
* @property array $idx
* @property bool $checkIdx
* @property string $partnerId
* @property DateTimeInterface $expirationDate
* @property bool $single
* @property bool $noUnicode
* @property bool $normalize
* @property string $notifyUrl
* @property bool $test
* @property string $timeRestriction
*/
#[\AllowDynamicProperties]
class ScheduleSmsToGroupBag
{
/** @var string */
public $group;
/** @var bool */
public $dateValidate = true;
/** @var DateTimeInterface */
public $date;
public static function withMessage(DateTimeInterface $scheduleAt, string $group, string $message): self
{
$bag = new self();
$bag->date = $scheduleAt;
$bag->group = $group;
$bag->message = $message;
return $bag;
}
public static function withTemplateName(DateTimeInterface $scheduleAt, string $group, string $templateName): self
{
$bag = new self();
$bag->date = $scheduleAt;
$bag->group = $group;
$bag->template = $templateName;
return $bag;
}
/**
* @param bool|null $checkIdx
*/
public function setExternalId(string $idx, $checkIdx = null): self
{
$this->idx = [$idx];
$this->checkIdx = $checkIdx;
return $this;
}
/**
* @deprecated
* @see ScheduleSmsToGroupBag::setExternalId()
*/
/**
* @param bool|null $checkIdx
*/
public function setIdx(array $idx, $checkIdx = null): self
{
$this->idx = $idx;
$this->checkIdx = $checkIdx;
return $this;
}
}