1 | <?php |
||
14 | class TargetAudience implements \JsonSerializable |
||
15 | { |
||
16 | use UtilityTrait; |
||
17 | use ValidatorTrait; |
||
18 | |||
19 | private const AUDIENCE_TYPE_ALL = 'all'; |
||
20 | private const AUDIENCE_TYPE_CUSTOM = 'custom'; |
||
21 | private const AUDIENCE_TYPE_NONE = 'none'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $audienceType; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $whitelistCountries; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $blacklistCountries; |
||
37 | |||
38 | /** |
||
39 | * TargetAudience constructor. |
||
40 | * |
||
41 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
42 | */ |
||
43 | 2 | public function __construct( |
|
56 | |||
57 | /** |
||
58 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
59 | * |
||
60 | * @return \Kerox\Messenger\Model\ProfileSettings\TargetAudience |
||
61 | */ |
||
62 | 2 | public static function create( |
|
69 | |||
70 | /** |
||
71 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
72 | * |
||
73 | * @return \Kerox\Messenger\Model\ProfileSettings\TargetAudience |
||
74 | */ |
||
75 | 1 | public function addWhitelistCountry(string $country): self |
|
83 | |||
84 | /** |
||
85 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
86 | * |
||
87 | * @return \Kerox\Messenger\Model\ProfileSettings\TargetAudience |
||
88 | */ |
||
89 | 1 | public function addBlacklistCountry(string $country): self |
|
97 | |||
98 | /** |
||
99 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
100 | */ |
||
101 | 1 | private function isValidCountries(array $countries): void |
|
109 | |||
110 | /** |
||
111 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
112 | */ |
||
113 | 2 | private function isValidAudienceType(string $audienceType): void |
|
120 | |||
121 | 2 | private function getAllowedAudienceType(): array |
|
129 | |||
130 | 1 | public function toArray(): array |
|
142 | |||
143 | 1 | public function jsonSerialize(): array |
|
147 | } |
||
148 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.