1: <?php
2:
3: namespace Charcoal\Cms;
4:
5: // From 'charcoal-translator'
6: use Charcoal\Translator\Translation;
7:
8: // From 'charcoal-cms'
9: use Charcoal\Cms\AbstractSection;
10:
11: /**
12: * External section may appear in menus and breadcrumbs, but only
13: *
14: * Unlike all other section types, they do not provide any metadata information.
15: */
16: class ExternalSection extends AbstractSection
17: {
18: /**
19: * @var Translation|string|null
20: */
21: private $externalUrl;
22:
23: /**
24: * @param mixed $url The external URL (localized).
25: * @return self
26: */
27: public function setExternalUrl($url)
28: {
29: $this->externalUrl = $this->translator()->translation($url);
30:
31: return $this;
32: }
33:
34: /**
35: * @return Translation|string|null
36: */
37: public function externalUrl()
38: {
39: return $this->externalUrl;
40: }
41: }
42: