Fix bug in and add validity check in MDObjectSyndicationSet

This commit is contained in:
Joshua Ramon Enslin 2021-07-15 16:56:54 +02:00
parent c4ac0f0fb4
commit 3ea3a9f2c0
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -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.
*