*/ declare(strict_types = 1); /** * Class containing static functions for getting available licenses on md. */ class MDLicensesSet extends MDValueSet { const AVAILABLE_LICENSES = [ 'CC BY-NC-SA' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/', 'CC BY-NC-ND' => 'https://creativecommons.org/licenses/by-nc-nd/4.0/', 'CC BY-NC' => 'https://creativecommons.org/licenses/by-nc/4.0/', 'CC BY-ND' => 'https://creativecommons.org/licenses/by-nd/4.0/', 'CC BY-SA' => 'https://creativecommons.org/licenses/by-sa/4.0/', 'CC BY' => 'https://creativecommons.org/licenses/by/4.0/', 'CC0' => 'https://creativecommons.org/publicdomain/zero/1.0/', 'RR-F' => 'https://www.europeana.eu/rights/rr-f/', 'RR-P' => 'https://www.europeana.eu/rights/rr-p/', 'RR-R' => 'https://www.europeana.eu/rights/rr-r/', 'Public Domain Mark' => 'https://creativecommons.org/publicdomain/mark/1.0/', 'Orphan Work' => 'https://www.europeana.eu/rights/orphan-work-eu/', ]; /** * Function for checking the availability of a provided license at * museum-digital. * If the license is available, the corresponding URL is returned. Else, false * is returned. * * @param string $license License to check. * * @return string|boolean */ final public static function checkLicenseAvailable(string $license) { if (isset(self::AVAILABLE_LICENSES[$license])) return self::AVAILABLE_LICENSES[$license]; return false; } }