src/Forms/Fields/FieldsRepository.php
public function addField(FieldTypeInterface $field, SectionInterface $group): FieldsRepositoryInterface
    {
        // We store all fields together
        // as well as per group. On each form,
        // there is a "default" group defined where
        // all fields are attached to. A user can specify
        // a form group to the passed options on the "add"
        // method of the FormBuilder instance.
        $this->fields[$field->getBaseName()] = $field;
        $this->groups[$group->getId()] = $group;

        return $this;
    }
public function addField(FieldTypeInterface $field, SectionInterface $group): FieldsRepositoryInterface
    {
        // We store all fields together
        // as well as per group. On each form,
        // there is a "default" group defined where
        // all fields are attached to. A user can specify
        // a form group to the passed options on the "add"
        // method of the FormBuilder instance.
        $this->fields[$field->getBaseName()] = $field;
        $this->groups[$group->getId()] = $group;

        return $this;
    }
public function addField ( FieldTypeInterface $ field , SectionInterface $ group ) : FieldsRepositoryInterface { // We store all fields together // as well as per group. On each form, // there is a "default" group defined where // all fields are attached to. A user can specify // a form group to the passed options on the "add" // method of the FormBuilder instance. $ this -> fields [ $ field -> getBaseName ( ) ] = $ field ; $ this -> groups [ $ group -> getId ( ) ] = $ group ; return $ this ; }
Add a field to the form instance.

@param FieldTypeInterface $field
@param SectionInterface   $group

@return FieldsRepositoryInterface
Add a field to the form instance .