1<?php 2 3 4namespace ComboStrap; 5 6 7use DateTime; 8 9/** 10 11 * @package ComboStrap 12 * Represents the wiki path of the page resource 13 */ 14class PagePath extends MetadataWikiPath 15{ 16 17 18 19 public const PROPERTY_NAME = "path"; 20 21 22 23 public static function createForPage(ResourceCombo $page): CacheExpirationDate 24 { 25 return (new CacheExpirationDate()) 26 ->setResource($page); 27 } 28 29 public function getDefaultValue(): ?DateTime 30 { 31 return null; 32 } 33 34 public function getValue(): ?string 35 { 36 return $this->getResource()->getPath()->toString(); 37 } 38 39 40 static public function getName(): string 41 { 42 return self::PROPERTY_NAME; 43 } 44 45 46 public function getPersistenceType(): string 47 { 48 return Metadata::DERIVED_METADATA; 49 } 50 51 52 public function getTab(): string 53 { 54 return MetaManagerForm::TAB_REDIRECTION_VALUE; 55 } 56 57 public function getDescription(): string 58 { 59 return "The path of the page on the file system (in wiki format with the colon `:` as path separator)"; 60 } 61 62 public function getLabel(): string 63 { 64 return "Page Path"; 65 } 66 67 public function getMutable(): bool 68 { 69 return false; 70 } 71 72 public function getCanonical(): string 73 { 74 return self::PROPERTY_NAME; 75 } 76 77 78} 79