Add controlled lists for loan types and object (ownership) status
This commit is contained in:
48
src/MDObjectStatusSet.php
Normal file
48
src/MDObjectStatusSet.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?PHP
|
||||
/**
|
||||
* Contains a list of states an object can be in for inventorization.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Contains a list of states an object can be in for inventorization.
|
||||
*/
|
||||
final class MDObjectStatusSet extends MDValueSet {
|
||||
|
||||
const DEFAULT_OBJECT_STATUS_TYPE = 'owned';
|
||||
|
||||
const OBJECT_STATUS_TYPES = [
|
||||
'owned',
|
||||
'permanent_loan',
|
||||
'borrowed',
|
||||
'to_check_for_gift',
|
||||
'to_check',
|
||||
'deaccessed',
|
||||
];
|
||||
|
||||
/**
|
||||
* Gets an unsorted list of the entries in a translated version.
|
||||
*
|
||||
* @param MDTlLoader $tlLoader Translation loader.
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function getUnsortedList(MDTlLoader $tlLoader):array {
|
||||
return parent::getTlUnsortedList($tlLoader, self::OBJECT_STATUS, "object_status", "object_status");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of the entries in a translated version.
|
||||
*
|
||||
* @param MDTlLoader $tlLoader Translation loader.
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function getSortedList(MDTlLoader $tlLoader):array {
|
||||
return parent::getTlSortedList($tlLoader, self::OBJECT_STATUS, "object_status", "object_status");
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user