Skip to content
Snippets Groups Projects
Commit 7af4618b authored by paul121's avatar paul121 Committed by Michael Stenta
Browse files

Issue #3253430 by paul121: Define all callback_allowed_values_function parameters

Accidentally merged the wrong commit earlier.
parent 90338a68
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,12 @@
*/
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* Allowed values callback function for the land type field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $definition
* @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
* The field definition.
* @param \Drupal\Core\Entity\ContentEntityInterface|null $entity
* The entity being created if applicable.
......@@ -21,7 +21,7 @@ use Drupal\Core\Field\FieldDefinitionInterface;
* @return array
* Returns an array of allowed values for use in form select options.
*/
function farm_land_type_field_allowed_values(FieldDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
function farm_land_type_field_allowed_values(FieldStorageDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
/** @var \Drupal\farm_land\Entity\FarmLandTypeInterface[] $types */
$types = \Drupal::entityTypeManager()->getStorage('land_type')->loadMultiple();
$allowed_values = [];
......
......@@ -6,12 +6,12 @@
*/
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* Allowed values callback function for the structure type field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $definition
* @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
* The field definition.
* @param \Drupal\Core\Entity\ContentEntityInterface|null $entity
* The entity being created if applicable.
......@@ -21,7 +21,7 @@ use Drupal\Core\Field\FieldDefinitionInterface;
* @return array
* Returns an array of allowed values for use in form select options.
*/
function farm_structure_type_field_allowed_values(FieldDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
function farm_structure_type_field_allowed_values(FieldStorageDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
/** @var \Drupal\farm_structure\Entity\FarmStructureTypeInterface[] $types */
$types = \Drupal::entityTypeManager()->getStorage('structure_type')->loadMultiple();
$allowed_values = [];
......
......@@ -7,6 +7,7 @@
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Render\Element;
use Drupal\quantity\Entity\QuantityInterface;
use Drupal\quantity\Event\QuantityEvent;
......@@ -67,7 +68,7 @@ function quantity_measures() {
/**
* Allowed values callback function for the quantity measure field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $definition
* @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
* The field definition.
* @param \Drupal\Core\Entity\ContentEntityInterface|null $entity
* The entity being created if applicable.
......@@ -77,7 +78,7 @@ function quantity_measures() {
* @return array
* Returns an array of allowed values for use in form select options.
*/
function quantity_measure_field_allowed_values(FieldDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
function quantity_measure_field_allowed_values(FieldStorageDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
// Start an empty options array.
$options = [];
......
......@@ -6,12 +6,12 @@
*/
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* Allowed values callback function for the lab test type field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $definition
* @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
* The field definition.
* @param \Drupal\Core\Entity\ContentEntityInterface|null $entity
* The entity being created if applicable.
......@@ -21,7 +21,7 @@ use Drupal\Core\Field\FieldDefinitionInterface;
* @return array
* Returns an array of allowed values for use in form select options.
*/
function farm_lab_test_type_field_allowed_values(FieldDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
function farm_lab_test_type_field_allowed_values(FieldStorageDefinitionInterface $definition, ContentEntityInterface $entity = NULL, bool &$cacheable = TRUE) {
/** @var \Drupal\farm_lab_test\Entity\FarmLabTestTypeInterface[] $lab_test_types */
$lab_test_types = \Drupal::entityTypeManager()->getStorage('lab_test_type')->loadMultiple();
$allowed_values = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment