src/Action/RetrieveAutocompleteItemsAction.php
private function retrieveFilterFieldDescription(
        AdminInterface $admin,
        string $field
    ): FieldDescriptionInterface {
        $admin->getFilterFieldDescriptions();

        $fieldDescription = $admin->getFilterFieldDescription($field);

        if (!$fieldDescription) {
            throw new \RuntimeException(sprintf('The field "%s" does not exist.', $field));
        }

        if (null === $fieldDescription->getTargetEntity()) {
            throw new \RuntimeException(sprintf('No associated entity with field "%s".', $field));
        }

        return $fieldDescription;
    }
private function retrieveFilterFieldDescription(
        AdminInterface $admin,
        string $field
    ): FieldDescriptionInterface {
        $admin->getFilterFieldDescriptions();

        $fieldDescription = $admin->getFilterFieldDescription($field);

        if (!$fieldDescription) {
            throw new \RuntimeException(sprintf('The field "%s" does not exist.', $field));
        }

        if (null === $fieldDescription->getTargetEntity()) {
            throw new \RuntimeException(sprintf('No associated entity with field "%s".', $field));
        }

        return $fieldDescription;
    }
private function retrieveFilterFieldDescription ( AdminInterface $ admin , string $ field ) : FieldDescriptionInterface { $ admin -> getFilterFieldDescriptions ( ) ; $ fieldDescription = $ admin -> getFilterFieldDescription ( $ field ) ; if ( ! $ fieldDescription ) { throw new \ RuntimeException ( sprintf ( 'The field "%s" does not exist.' , $ field ) ) ; } if ( null === $ fieldDescription -> getTargetEntity ( ) ) { throw new \ RuntimeException ( sprintf ( 'No associated entity with field "%s".' , $ field ) ) ; } return $ fieldDescription ; }
Retrieve the filter field description given by field name.

@throws \RuntimeException
Retrieve the filter field description given by field name .