Releases: AppsDevTeam/doctrine-forms
Releases · AppsDevTeam/doctrine-forms
v2.4.1: Revert "Prevents overwriting existing relations"
v2.4.0: Prevents overwriting existing relations
Ensures that existing related entities are not overwritten when mapping form data to entities, specifically in to-many relationships. It first checks if a component within the container represents a single identifier field. If it does, it attempts to find an existing entity using the identifier's value. Only if no such entity is found, a new entity is created. This prevents the creation of duplicate entities and ensures that existing relationships are maintained.
v2.3.2: Prevents duplicate entities in to-many collections
Ensures that entities are not added to to-many collections multiple times. This prevents issues where the setter within `createEntity` might automatically add the entity to the collection, leading to duplicates.
v2.3.1: Skips new entities in to-many relation deletion
Prevents attempting to delete new entities in to-many relations. These entities are not yet persisted and should not be considered for deletion.
v2.3.0: Adds deleted collection entity listener
Adds a listener to handle deletion of entities in to-many collections. This change introduces a mechanism to properly delete entities that are removed from a to-many collection during form processing. It ensures that orphaned entities are removed from the database, preventing data inconsistencies. It finds the instance of the listener if exists and calls its addDeletedEntity method to persist a deleted entity. Also, the onAfterMapToForm method in BaseForm is updated to pass the entity to the event.
v2.2.3: Invokes initEntity with form values
Ensures that the `initEntity` method receives form values when it is invoked. This allows the method to use the form data to further initialize the entity.
v2.2.2: Improves Doctrine forms and entity handling
Updates dependencies, including PHP version and doctrine-components. Refactors BaseForm and related interfaces to enhance entity handling and type safety, utilizing ADT\DoctrineComponents\Entities\Entity where appropriate. Enhances overall robustness and maintainability of the Doctrine forms functionality.
v2.2.1: Adds BaseFormInterface
Introduces BaseFormInterface to define contract for form base classes. This interface standardizes form initialization and entity mapping processes, ensuring consistency and facilitating extension.
v2.2.0: Allows mapping to a different entity
The `mapToEntity` function now accepts an optional entity parameter. This enables mapping form data to an entity other than the one initially associated with the form, providing greater flexibility in data handling.
v2.1.7: Handles entity creation and persistence
Streamlines entity creation by allowing either a callable or a 'createEntity' method to be used. Ensures the entity is persisted after creation and initialization, improving data management.