| 1 | <?php |
||
| 16 | final class Title extends SerializeToString |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * The title is displayed as larger, bold text near the top of a message attachment. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private $title; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * By passing a valid URL in the link parameter (optional), the title text will be hyperlinked. |
||
| 27 | * |
||
| 28 | * @var Url|null |
||
| 29 | */ |
||
| 30 | private $link; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $title |
||
| 34 | * @param Url|null $link |
||
| 35 | */ |
||
| 36 | 10 | public function __construct($title, Url $link = null) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 8 | public function getTitle() |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | 8 | public function hasLink() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @return Url|null |
||
| 60 | */ |
||
| 61 | 2 | public function getLink() |
|
| 65 | |||
| 66 | /** |
||
| 67 | * {@inheritdoc} |
||
| 68 | */ |
||
| 69 | 8 | public function __toString() |
|
| 73 | } |
||
| 74 |