src/Taxonomy/TaxonomyFieldRepository.php
public function getFieldByName(string $name)
    {
        $found = array_filter($this->fields, function ($field) use ($name) {
            /** @var FieldTypeInterface $field */
            return $name === $field->getBaseName();
        });

        if (! empty($found)) {
            return array_pop($found);
        }

        throw new TaxonomyFieldNotFoundException("Taxonomy field with a name of {$name} not found.");
    }
public function getFieldByName(string $name)
    {
        $found = array_filter($this->fields, function ($field) use ($name) {
            /** @var FieldTypeInterface $field */
            return $name === $field->getBaseName();
        });

        if (! empty($found)) {
            return array_pop($found);
        }

        throw new TaxonomyFieldNotFoundException("Taxonomy field with a name of {$name} not found.");
    }
public function getFieldByName ( string $ name ) { $ found = array_filter ( $ this -> fields , function ( $ field ) use ( $ name ) { /** @var FieldTypeInterface $field */ return $ name === $ field -> getBaseName ( ) ; } ) ; if ( ! empty ( $ found ) ) { return array_pop ( $ found ) ; } throw new TaxonomyFieldNotFoundException ( "Taxonomy field with a name of {$name} not found." ) ; }
Return a field instance by name.

@param string $name

@throws TaxonomyFieldNotFoundException

@return FieldTypeInterface
Return a field instance by name .