| 1 | <?php |
||
| 14 | class Url implements UrlInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Always visit url. |
||
| 18 | */ |
||
| 19 | public const FREQUENCE_ALWAYS = 'always'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Visit url every hour. |
||
| 23 | */ |
||
| 24 | public const FREQUENCE_HOURLY = 'hourly'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Visit url every day. |
||
| 28 | */ |
||
| 29 | public const FREQUENCE_DAILY = 'daily'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Visit url every week. |
||
| 33 | */ |
||
| 34 | public const FREQUENCE_WEEKLY = 'weekly'; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Visit url every month. |
||
| 38 | */ |
||
| 39 | public const FREQUENCE_MONTHLY = 'monthly'; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Visit url every year. |
||
| 43 | */ |
||
| 44 | public const FREQUENCE_YEARLY = 'yearly'; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Never visit url again. |
||
| 48 | */ |
||
| 49 | public const FREQUENCE_NEVER = 'never'; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var string |
||
| 53 | */ |
||
| 54 | protected $loc; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @var \DateTime|null |
||
| 58 | */ |
||
| 59 | protected $lastMod; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var string|null |
||
| 63 | */ |
||
| 64 | protected $changeFreq; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var int|null |
||
| 68 | */ |
||
| 69 | protected $priority; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param string $loc |
||
| 73 | * @param int|null $priority |
||
| 74 | * @param null|string $changeFreq |
||
| 75 | * @param \DateTime|null $lastMod |
||
| 76 | */ |
||
| 77 | public function __construct(string $loc, ?int $priority = null, ?string $changeFreq = null, ?\DateTime $lastMod = null) |
||
| 84 | |||
| 85 | /** |
||
| 86 | * {@inheritdoc} |
||
| 87 | */ |
||
| 88 | public function getChangeFreq(): ?string |
||
| 92 | |||
| 93 | /** |
||
| 94 | * {@inheritdoc} |
||
| 95 | */ |
||
| 96 | public function getLastMod(): ?\DateTime |
||
| 100 | |||
| 101 | /** |
||
| 102 | * {@inheritdoc} |
||
| 103 | */ |
||
| 104 | public function getLoc(): string |
||
| 108 | |||
| 109 | /** |
||
| 110 | * {@inheritdoc} |
||
| 111 | */ |
||
| 112 | public function getPriority(): ?int |
||
| 116 | } |
||
| 117 |