Skip to content

[DoctrineBridge] Add EntityValidationListener to allow auto validation on flush #53447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Jan 7, 2024

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

The idea is to have entities get validated automatically through a listener, eg:

#[EnableAutoValidation]
class SomeEntity
{}

$this->entityManager->persist($someEntity);
try {
    $this->entityManager->flush();
} catch (EntityValidationFailedException $e) {
    dump($e);
}

I think this could be useful sometimes, so I'd like to hear other people's thoughts.

@HypeMC HypeMC force-pushed the add-entity-validation-listener branch from b5b3c48 to d8b1940 Compare January 7, 2024 06:40
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@fabpot fabpot modified the milestones: 7.3, 7.4 May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants