| 1 | <?php |
||
| 14 | final class ChangeFreq |
||
| 15 | { |
||
| 16 | public const ALWAYS = 'always'; |
||
| 17 | |||
| 18 | public const HOURLY = 'hourly'; |
||
| 19 | |||
| 20 | public const DAILY = 'daily'; |
||
| 21 | |||
| 22 | public const WEEKLY = 'weekly'; |
||
| 23 | |||
| 24 | public const MONTHLY = 'monthly'; |
||
| 25 | |||
| 26 | public const YEARLY = 'yearly'; |
||
| 27 | |||
| 28 | public const NEVER = 'never'; |
||
| 29 | |||
| 30 | private const CHANGE_FREQ_PRIORITY = [ |
||
| 31 | '1.0' => self::HOURLY, |
||
| 32 | '0.9' => self::DAILY, |
||
| 33 | '0.8' => self::DAILY, |
||
| 34 | '0.7' => self::WEEKLY, |
||
| 35 | '0.6' => self::WEEKLY, |
||
| 36 | '0.5' => self::WEEKLY, |
||
| 37 | '0.4' => self::MONTHLY, |
||
| 38 | '0.3' => self::MONTHLY, |
||
| 39 | '0.2' => self::YEARLY, |
||
| 40 | '0.1' => self::YEARLY, |
||
| 41 | '0.0' => self::NEVER, |
||
| 42 | ]; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param \DateTimeInterface $last_mod |
||
| 46 | * |
||
| 47 | * @return string|null |
||
| 48 | */ |
||
| 49 | 16 | public static function getByLastMod(\DateTimeInterface $last_mod): ?string |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @param string $priority |
||
| 68 | * |
||
| 69 | * @return string|null |
||
| 70 | */ |
||
| 71 | 41 | public static function getByPriority(string $priority): ?string |
|
| 75 | } |
||
| 76 |