1 | <?php |
||
15 | final class Author extends SerializeToString |
||
16 | { |
||
17 | /** |
||
18 | * Small text used to display the author's name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * A valid URL that will hyperlink the name. |
||
26 | * |
||
27 | * @var Url|null |
||
28 | */ |
||
29 | private $url; |
||
30 | |||
31 | /** |
||
32 | * A valid URL that displays a small 16x16px image to the left of the name. |
||
33 | * |
||
34 | * @var Url|null |
||
35 | */ |
||
36 | private $icon; |
||
37 | |||
38 | /** |
||
39 | * Author constructor. |
||
40 | * |
||
41 | * @param string $name |
||
42 | * @param Url|null $url |
||
43 | * @param Url|null $icon |
||
44 | */ |
||
45 | 3 | public function __construct($name, Url $url = null, Url $icon = null) |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getName() |
|
59 | |||
60 | /** |
||
61 | * @return null|Url |
||
62 | */ |
||
63 | 1 | public function getUrl() |
|
67 | |||
68 | /** |
||
69 | * @return bool |
||
70 | */ |
||
71 | 1 | public function hasUrl() |
|
75 | |||
76 | /** |
||
77 | * @return null|Url |
||
78 | */ |
||
79 | 1 | public function getIcon() |
|
83 | |||
84 | /** |
||
85 | * @return null |
||
86 | */ |
||
87 | 1 | public function hasIcon() |
|
91 | |||
92 | /** |
||
93 | * @inheritDoc |
||
94 | */ |
||
95 | 1 | public function __toString() |
|
99 | } |
||
100 |