From 3ea3a9f2c0fa53f71cc6b702d508e65bdbb3fd0f Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 15 Jul 2021 16:56:54 +0200 Subject: [PATCH] Fix bug in and add validity check in MDObjectSyndicationSet --- src/MDObjectSyndicationSet.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/MDObjectSyndicationSet.php b/src/MDObjectSyndicationSet.php index f3ae1d2..ea74cdd 100644 --- a/src/MDObjectSyndicationSet.php +++ b/src/MDObjectSyndicationSet.php @@ -39,7 +39,7 @@ final class MDObjectSyndicationSet extends MDValueSet { * * @return string */ - public function getSearchUrlForObject(string $repo, string $instId, string $search_value):string { + public static function getSearchUrlForObject(string $repo, string $instId, string $search_value):string { switch ($repo) { case 'ddb': @@ -50,6 +50,22 @@ final class MDObjectSyndicationSet extends MDValueSet { } + /** + * Function for checking the availability of a provided repository in the + * list of known repositories. + * + * @param string $repo Repository name to check. + * + * @return string|boolean + */ + final public static function checkRepositoryIsKnown(string $repo) { + if (isset(self::REPOSITORIES[$repo])) { + return self::REPOSITORIES[$repo]; + } + return false; + + } + /** * Gets a sorted list of the entries in a translated version. *