protected function injectFieldInService($fieldName)
    {
        $formObject = $this->formService->getFormObject();
        $formConfiguration = $formObject->getConfiguration();

        if (false === is_string($fieldName)) {
            throw InvalidArgumentTypeException::fieldViewHelperInvalidTypeNameArgument();
        } elseif (false === $formConfiguration->hasField($fieldName)) {
            throw PropertyNotAccessibleException::fieldViewHelperFieldNotAccessibleInForm($formObject, $fieldName);
        }

        $this->fieldService->setCurrentField($formConfiguration->getField($fieldName));
    }
protected function injectFieldInService($fieldName)
    {
        $formObject = $this->formService->getFormObject();
        $formConfiguration = $formObject->getConfiguration();

        if (false === is_string($fieldName)) {
            throw InvalidArgumentTypeException::fieldViewHelperInvalidTypeNameArgument();
        } elseif (false === $formConfiguration->hasField($fieldName)) {
            throw PropertyNotAccessibleException::fieldViewHelperFieldNotAccessibleInForm($formObject, $fieldName);
        }

        $this->fieldService->setCurrentField($formConfiguration->getField($fieldName));
    }
protected function injectFieldInService ( $ fieldName ) { $ formObject = $ this -> formService -> getFormObject ( ) ; $ formConfiguration = $ formObject -> getConfiguration ( ) ; if ( false === is_string ( $ fieldName ) ) { throw InvalidArgumentTypeException :: fieldViewHelperInvalidTypeNameArgument ( ) ; } elseif ( false === $ formConfiguration -> hasField ( $ fieldName ) ) { throw PropertyNotAccessibleException :: fieldViewHelperFieldNotAccessibleInForm ( $ formObject , $ fieldName ) ; } $ this -> fieldService -> setCurrentField ( $ formConfiguration -> getField ( $ fieldName ) ) ; }
Will check that the given field exists in the current form definition and
inject it in the `FieldService` as `currentField`.

Throws an error if the field is not found or incorrect.

@param string $fieldName
@throws InvalidArgumentTypeException
@throws PropertyNotAccessibleException
Will check that the given field exists in the current form definition and inject it in the FieldService as currentField .