1<?php 2 3 4namespace ComboStrap; 5 6use ComboStrap\Meta\Api\Metadata; 7use ComboStrap\Meta\Api\MetadataStore; 8use ComboStrap\Meta\Api\MetadataStoreAbs; 9 10/** 11 * Class TemplateStore 12 * @package ComboStrap 13 * The data goes from and out of a template format 14 */ 15class TemplateStore extends MetadataStoreAbs implements MetadataStore 16{ 17 18 const CANONICAL = "template"; 19 20 public function set(Metadata $metadata) 21 { 22 LogUtility::msg("You can't set a value with a template store"); 23 } 24 25 public function get(Metadata $metadata, $default = null) 26 { 27 LogUtility::msg("You can't get a value with a template store"); 28 } 29 30 31 public function getFromName(string $name, $default = null) 32 { 33 LogUtility::msg("You can't get a value with a template store"); 34 } 35 36 public function setFromPersistentName(string $name, $value, $default = null) 37 { 38 LogUtility::msg("You can't set a value with a template store"); 39 } 40 41 public function persist() 42 { 43 LogUtility::msg("You can't persist with a template store"); 44 } 45 46 public function isHierarchicalTextBased(): bool 47 { 48 return true; 49 } 50 51 public function reset() 52 { 53 LogUtility::msg("Reset: The template format is not yet implemented"); 54 } 55 56 public function getCanonical(): string 57 { 58 return self::CANONICAL; 59 } 60 61 static function getOrCreateFromResource(ResourceCombo $resourceCombo): MetadataStore 62 { 63 return new TemplateStore($resourceCombo); 64 } 65} 66