| 1 | <?php |
||
| 5 | class MessagebirdMessage |
||
| 6 | { |
||
| 7 | public $body; |
||
| 8 | public $originator; |
||
| 9 | public $recipients; |
||
| 10 | public $reference; |
||
| 11 | public $reportUrl; |
||
| 12 | |||
| 13 | 2 | public static function create($body = '') |
|
| 17 | |||
| 18 | 12 | public function __construct($body = '') |
|
| 24 | |||
| 25 | 1 | public function setBody($body) |
|
| 31 | |||
| 32 | 4 | public function setOriginator($originator) |
|
| 38 | |||
| 39 | 7 | public function setRecipients($recipients) |
|
| 49 | |||
| 50 | 2 | public function setReference($reference) |
|
| 56 | |||
| 57 | public function setDatacoding($datacoding) |
||
| 63 | |||
| 64 | public function setReportUrl($reportUrl) |
||
| 70 | |||
| 71 | public function toJson() |
||
| 75 | } |
||
| 76 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: