Add controlled lists for loan types and object (ownership) status
This commit is contained in:
parent
a75954ffae
commit
8256231b9c
2
l18n
2
l18n
|
@ -1 +1 @@
|
|||
Subproject commit 188f5370b6f8db14e7ff344e79d039c1121ff4cc
|
||||
Subproject commit 4cea8aba9e47ce802ec0284818aec9f8a8406799
|
44
src/MDLoanTypesSet.php
Normal file
44
src/MDLoanTypesSet.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?PHP
|
||||
/**
|
||||
* Contains a list of types of loans.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Contains a list of types of loans.
|
||||
*/
|
||||
final class MDLoanTypesSet extends MDValueSet {
|
||||
|
||||
const DEFAULT_LOAN_TYPE = 'outgoing';
|
||||
|
||||
const LOAN_TYPES = [
|
||||
'outgoing',
|
||||
'incoming',
|
||||
];
|
||||
|
||||
/**
|
||||
* 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::LOAN_TYPES, "loan_types", "loan_types");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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::LOAN_TYPES, "loan_types", "loan_types");
|
||||
|
||||
}
|
||||
}
|
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");
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user