csvxml/classes/FieldEntry.php

48 lines
1.5 KiB
PHP

<?PHP
/**
* Contains a helper class for a field entry.
*
* @author Nathan Eikermann <nathan@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class holding the information for a field entry.
*/
final class FieldEntry {
public readonly bool $required;
public readonly string $remark;
public readonly string $name_human_readable;
public readonly string $explica;
/** @var array<string> */
public readonly array $allowedValues;
/** @var array<string> */
public readonly array $dependsOn;
/**
* Function for constructing a new FieldEntry Object.
*
* @param boolean $required True if the field is required.
* @param array<string> $allowedValues Array of allowed values.
* @param array<string> $dependsOn Array of fields the entry depends on.
* @param string $remark Remark.
* @param string $name_human_readable Human readable translation.
* @param string $explica Explanation.
*/
public function __construct(
bool $required, array $allowedValues,
array $dependsOn, string $remark,
string $name_human_readable, string $explica
) {
$this->required = $required;
$this->allowedValues = $allowedValues;
$this->dependsOn = $dependsOn;
$this->remark = $remark;
$this->name_human_readable = $name_human_readable;
$this->explica = $explica;
}
}