setResource($resource); } static public function getDescription(): string { return "An illustrative icon for the page"; } static public function getLabel(): string { return "Featured Icon"; } public static function getName(): string { return self::PROPERTY_NAME; } static public function isMutable(): bool { return true; } static public function getPersistenceType(): string { return Metadata::PERSISTENT_METADATA; } public function getDefaultValue(): WikiPath { /** * @var MarkupPath $page */ $page = $this->getResource(); if($page->isRootHomePage()){ try { return Site::getLogoAsSvgImage(); } catch (ExceptionNotFound $e) { // not found } } /** * * Image set by {@link \syntax_plugin_combo_media::registerFirstImage()} */ $iconImageParsed = $this->getReadStore()->getFromName(FeaturedIcon::FIRST_ICON_PARSED); if ($iconImageParsed !== null) { return WikiPath::createMediaPathFromId($iconImageParsed); } throw new ExceptionNotFound(); } static public function getDrive(): string { return WikiPath::MEDIA_DRIVE; } static public function isOnForm(): bool { return true; } }