setResource($resource); } static public function getDescription(): string { return "The first image"; } static public function getLabel(): string { return "First Image"; } public static function getName(): string { return self::PROPERTY_NAME; } static public function isMutable(): bool { return false; } /** * @return WikiPath * @throws ExceptionNotFound */ public function getValue(): WikiPath { $contextPage = $this->getResource(); try { return FirstSvgIllustration::createForPage($contextPage)->getValue(); } catch (ExceptionNotFound $e) { return FirstRasterImage::createForPage($contextPage)->getValue(); } } static public function getPersistenceType(): string { return Metadata::DERIVED_METADATA; } static public function getDrive(): string { return WikiPath::MEDIA_DRIVE; } static public function isOnForm(): bool { return true; } }