| 1 | <?php |
||
| 5 | class EngageMessage |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Notification url. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $url; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Notification message. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $body; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Notification icon. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $icon; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Notification title. |
||
| 30 | * |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | protected $subject; |
||
| 34 | |||
| 35 | 8 | public function __construct($body = '') |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Create a message. |
||
| 42 | * |
||
| 43 | * @param string $body |
||
| 44 | * @return static |
||
| 45 | */ |
||
| 46 | 1 | public static function create($body = '') |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Set the message body. |
||
| 53 | * |
||
| 54 | * @param string $value |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | 3 | public function body($value) |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Set the message subject. |
||
| 66 | * |
||
| 67 | * @param string $value |
||
| 68 | * @return $this |
||
| 69 | */ |
||
| 70 | 3 | public function subject($value) |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Set the message url. |
||
| 79 | * |
||
| 80 | * @param string $value |
||
| 81 | * @return $this |
||
| 82 | */ |
||
| 83 | 3 | public function url($value) |
|
| 89 | |||
| 90 | /** |
||
| 91 | * Set the message icon. |
||
| 92 | * |
||
| 93 | * @param string $value |
||
| 94 | * @return $this |
||
| 95 | */ |
||
| 96 | 3 | public function icon($value) |
|
| 102 | |||
| 103 | /** |
||
| 104 | * Get message as array. |
||
| 105 | * |
||
| 106 | * @return array |
||
| 107 | */ |
||
| 108 | 8 | public function toArray() |
|
| 122 | } |
||
| 123 |