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 public static function createForPage(ResourceCombo $page): CacheExpirationDate 23 { 24 return (new CacheExpirationDate()) 25 ->setResource($page); 26 } 27 28 public function getDefaultValue(): ?DateTime 29 { 30 return null; 31 } 32 33 public function getValue(): ?string 34 { 35 return $this->getResource()->getPath()->toString(); 36 } 37 38 39 static public function getName(): string 40 { 41 return self::PROPERTY_NAME; 42 } 43 44 45 public function getPersistenceType(): string 46 { 47 return Metadata::DERIVED_METADATA; 48 } 49 50 51 public function getTab(): string 52 { 53 return MetaManagerForm::TAB_REDIRECTION_VALUE; 54 } 55 56 public function getDescription(): string 57 { 58 return "The path of the page on the file system (in wiki format with the colon `:` as path separator)"; 59 } 60 61 public function getLabel(): string 62 { 63 return "Page Path"; 64 } 65 66 public function getMutable(): bool 67 { 68 return false; 69 } 70 71 public function getCanonical(): string 72 { 73 return self::PROPERTY_NAME; 74 } 75 76 77} 78