@param string $name

@throws \InvalidArgumentException

@return FieldDescriptionInterface
321293
public function get($name)
    {
        if ($this->has($name)) {
            return $this->elements[$name];
        }

        throw new \InvalidArgumentException(sprintf('Element "%s" does not exist.', $name));
    }
1014370
public function getParameter($name)
    {
        if (!isset($this->parameters[$name])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown parameter "%s", known parameters: "%s"',
                $name, implode('", "', array_keys($this->parameters))
            ));
        }

        return $this->parameters[$name];
    }
1125306
public function getField($name)
    {
        if ('pk' === $name) {
            $name = $this->getPrimaryKeyName();
        }

        $name = $this->getMappingName($name);

        if (isset($this->fields[$name])) {
            $field = $this->fields[$name];
            $field->cleanValue();

            return $field;
        }
    }
279954
public function getField($name)
		{
			return isset($this->fields[$name])
				? $this->fields[$name]
				: null;
		}
11956
public function getFieldType($name)
    {
        return $this->checkFieldExist($name)->types[$name] != null
            ? rtrim($this->types[$name], '[]')
            : null;
    }
1304642
public function getShowFieldDescription($name)
    {
        $this->buildShow();

        return $this->hasShowFieldDescription($name) ? $this->showFieldDescriptions[$name] : null;
    }
1330132
public function createDocument($name)
    {
        $doc = $this->extensions->createDocument($name);
        if ($doc) {
            return $doc;
        }

        throw new \InvalidArgumentException(sprintf('Unknown document "%s"', $name));
    }
790649
public function textarea(string $name, array $options = []): FieldTypeInterface
    {
        return (new TextareaType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
1267304
public function getField($name)
    {
        return (isset($this->fields[$name])) ? $this->fields[$name] : false;
    }
221410
public function get($name)
    {
        // Check if field exists when it is not a collection
        if (!$this->isColl && !in_array($name, $this->getFields())) {
            throw new \InvalidArgumentException(sprintf(
                'Field "%s" not found in record class "%s"',
                $name,
                get_class($this)
            ));
        }
        return isset($this->data[$name]) ? $this->data[$name] : null;
    }
1107091
public function getField($name)
    {
        $f = $this->hasField($name);

        if ($f === false) {
            throw new Exception(['Field is not defined in model', 'model' => get_class($this), 'field' => $name]);
        }

        return $f;
    }
719965
public function add($name, $type = null, array $options = [], array $fieldDescriptionOptions = [])
    {
        if (null !== $this->apply && !$this->apply) {
            return $this;
        }

        if ($name instanceof FormBuilderInterface) {
            $fieldName = $name->getName();
        } else {
            $fieldName = $name;
        }

        // "Dot" notation is not allowed as form name, but can be used as property path to access nested data.
        if (!$name instanceof FormBuilderInterface && !isset($options['property_path'])) {
            $options['property_path'] = $fieldName;

            // fix the form name
            $fieldName = $this->sanitizeFieldName($fieldName);
        }

        // change `collection` to `sonata_type_native_collection` form type to
        // avoid BC break problems
        if ('collection' === $type || SymfonyCollectionType::class === $type) {
            $type = CollectionType::class;
        }

        $label = $fieldName;

        $group = $this->addFieldToCurrentGroup($label);

        // Try to autodetect type
        if ($name instanceof FormBuilderInterface && null === $type) {
            $fieldDescriptionOptions['type'] = \get_class($name->getType()->getInnerType());
        }

        if (!isset($fieldDescriptionOptions['type']) && \is_string($type)) {
            $fieldDescriptionOptions['type'] = $type;
        }

        if ($group['translation_domain'] && !isset($fieldDescriptionOptions['translation_domain'])) {
            $fieldDescriptionOptions['translation_domain'] = $group['translation_domain'];
        }

        $fieldDescription = $this->admin->getModelManager()->getNewFieldDescriptionInstance(
            $this->admin->getClass(),
            $name instanceof FormBuilderInterface ? $name->getName() : $name,
            $fieldDescriptionOptions
        );

        // Note that the builder var is actually the formContractor:
        $this->builder->fixFieldDescription($this->admin, $fieldDescription, $fieldDescriptionOptions);

        if ($fieldName !== $name) {
            $fieldDescription->setName($fieldName);
        }

        $this->admin->addFormFieldDescription($fieldName, $fieldDescription);

        if ($name instanceof FormBuilderInterface) {
            $this->formBuilder->add($name);
        } else {
            // Note that the builder var is actually the formContractor:
            $options = array_replace_recursive($this->builder->getDefaultOptions($type, $fieldDescription), $options);

            // be compatible with mopa if not installed, avoid generating an exception for invalid option
            // force the default to false ...
            if (!isset($options['label_render'])) {
                $options['label_render'] = false;
            }

            if (!isset($options['label'])) {
                $options['label'] = $this->admin->getLabelTranslatorStrategy()->getLabel($fieldDescription->getName(), 'form', 'label');
            }

            $help = null;
            if (isset($options['help'])) {
                $help = $options['help'];
                unset($options['help']);
            }

            $this->formBuilder->add($fieldDescription->getName(), $type, $options);

            if (null !== $help) {
                $this->admin->getFormFieldDescription($fieldDescription->getName())->setHelp($help);
            }
        }

        return $this;
    }
745730
public function get(string $name): LinkInterface
    {
        if (!$this->has($name)) {
            throw new \InvalidArgumentException('Missing link ' . $name);
        }

        return $this->collection[$name];
    }
495117
public function field($name)
    {
        if (!isset($this->keyMap[$name])) {
            throw new Exception(sprintf('Unable to find %s named field.', $name));
        }
        return $this->controls[$this->keyMap[$name]];
    }
302849
final function FieldMapper($name)
    {
        $fieldMappers = $this->FieldMappers();
        if (!array_key_exists($name, $fieldMappers))
            throw new \InvalidArgumentException($name . ' is not a field of ' . $this->TableName());
        
        return $fieldMappers[$name];
    }
1053289
public function getField($name)
    {
        return $this->fields->has($name) ? $this->fields[$name] : null;
    }
1045910
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.");
    }