1 | <?php |
||
10 | class OrganizerProjectedToJSONLD implements SerializableInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $id; |
||
16 | |||
17 | /** |
||
18 | * @param string $id |
||
19 | * @param string $iri |
||
20 | */ |
||
21 | public function __construct($id, $iri) |
||
26 | |||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getId() |
||
34 | |||
35 | /** |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getIri() |
||
42 | |||
43 | /** |
||
44 | * @return array |
||
45 | */ |
||
46 | public function serialize() |
||
53 | |||
54 | /** |
||
55 | * @param array $data |
||
56 | * @return OrganizerProjectedToJSONLD |
||
57 | */ |
||
58 | public static function deserialize(array $data) |
||
62 | } |
||
63 |
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: