MDAllowedValueSets/src/enums/MDValueEnumInterface.php

66 lines
1.7 KiB
PHP
Raw Normal View History

<?PHP
/**
* Describes an interface for a fully implemented enum describing a
* list of controlled values at md. Expects the availabiliy of
* translations for each.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Describes an interface for a fully implemented enum describing a
* list of controlled values at md.
*/
interface MDValueEnumInterface {
/**
* Returns a value of this type based on a string.
*
* @param string $input Input to get a value from.
*
* @return MDValueEnumInterface
*/
public static function fromString(string $input):MDValueEnumInterface;
/**
* Lists the case names available.
*
* @return array<string>
*/
public static function caseNames():array;
/**
* Gets an unsorted array based on provided keys and their translations.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getUnsortedList(MDTlLoader $tlLoader):array;
/**
* Gets a list of entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array;
/**
* Returns the name of the current value in translation.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return string
*/
public function getTledName(MDTlLoader $tlLoader):string;
2022-10-16 01:13:33 +02:00
/**
* Provides the option to serialize as a string during json_encode().
*
* @return string
*/
public function jsonSerialize():string;
}