mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
23 lines
625 B
PHP
23 lines
625 B
PHP
<?php
|
|
|
|
/**
|
|
* @file
|
|
* The farmOS lab test log module.
|
|
*/
|
|
|
|
/**
|
|
* Allowed values callback function for the lab test type field.
|
|
*
|
|
* @return array
|
|
* Returns an array of allowed values for use in form select options.
|
|
*/
|
|
function farm_lab_test_type_field_allowed_values() {
|
|
/** @var \Drupal\farm_lab_test\Entity\FarmLabTestTypeInterface[] $lab_test_types */
|
|
$lab_test_types = \Drupal::entityTypeManager()->getStorage('lab_test_type')->loadMultiple();
|
|
$allowed_values = [];
|
|
foreach ($lab_test_types as $id => $lab_test_type) {
|
|
$allowed_values[$id] = $lab_test_type->getLabel();
|
|
}
|
|
return $allowed_values;
|
|
}
|