1<?php 2 3 4namespace ComboStrap; 5 6 7use ComboStrap\Meta\Api\Metadata; 8use ComboStrap\Meta\Api\MetadataDateTime; 9 10class StartDate extends MetadataDateTime 11{ 12 13 public const PROPERTY_NAME = "date_start"; 14 15 public static function createFromPage(MarkupPath $page) 16 { 17 return (new StartDate()) 18 ->setResource($page); 19 } 20 21 static public function getTab(): string 22 { 23 return MetaManagerForm::TAB_TYPE_VALUE; 24 } 25 26 static public function getDescription(): string 27 { 28 return "The start date of an event"; 29 } 30 31 static public function getLabel(): string 32 { 33 return "Start Date"; 34 } 35 36 static public function getName(): string 37 { 38 return self::PROPERTY_NAME; 39 } 40 41 static public function getPersistenceType(): string 42 { 43 return Metadata::PERSISTENT_METADATA; 44 } 45 46 static public function isMutable(): bool 47 { 48 return true; 49 } 50 51 public function getDefaultValue() 52 { 53 throw new ExceptionNotFound("Start date does not have any default value"); 54 } 55 56 static public function getCanonical(): string 57 { 58 return PageType::EVENT_TYPE; 59 } 60 61 62 static public function isOnForm(): bool 63 { 64 return true; 65 } 66} 67