public function afterAttach($formObject, $form, $mainEntity, $tag)
    {
        foreach ($this->getExcludedFieldsForEntityTag($tag) as $fieldName) {
            /* @var \Zend\Form\Form $form */
            $form->remove($fieldName);
        }
    }
public function afterAttach($formObject, $form, $mainEntity, $tag)
    {
        foreach ($this->getExcludedFieldsForEntityTag($tag) as $fieldName) {
            /* @var \Zend\Form\Form $form */
            $form->remove($fieldName);
        }
    }
public function afterAttach ( $ formObject , $ form , $ mainEntity , $ tag ) { foreach ( $ this -> getExcludedFieldsForEntityTag ( $ tag ) as $ fieldName ) { /* @var \Zend\Form\Form $form */ $ form -> remove ( $ fieldName ) ; } }
Function meant to be run as a callback for attacheToMainEntity.

In this case, it's being used to filter form fields from the sub
forms and entities.

@param $formObject
@param $form
@param $mainEntity
@param $tag
Function meant to be run as a callback for attacheToMainEntity .