Skip to content

Form element of inverse side of a bidirectional association is always removed #741

Description

@diniciacci

When a form is built from annotations (or attributes) if the form has an element that is an association, the element is removed from the form if it is on the inverse side of the association.

In case of a truly bidirectional (many-to-many) association implemented with best practices as suggested in https://gist.github.com/Ocramius/3121916 one might want to have forms generated from annotations (or attributes) to have the associated element on both sides i.e. also on the inverse side.

Currently EntityBasedFormBuilder checks to exclude an element here that triggers handleExcludeAssociation and this just checks if the element is the inverse side, and in that case, as a consequence, removes the element from the $formSpec.

This should be configurable, maybe with an appropriate annotation, ending up in the $metadata, that can be checked in the handleExcludeAssociation().

The annotation can be something like "bidirectional", to not mix the term with words like 'required', 'force' or 'keep'.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions