dmytrof/doctrine-modification-events-bundle
preUpdate, postUpdate). This is particularly valuable for audit logging, real-time notifications, or cascading operations triggered by entity changes.EventDispatcher and LifecycleEventArgs, reducing friction with existing event-driven architectures.EventDispatcher? If yes, how will this bundle coexist with existing listeners?User entity updates) to validate behavior.symfony/event-dispatcher, symfony/dependency-injection, and doctrine/orm. Ensure no version skew.Attribute system (e.g., [Doctrine\ORM\Mapping\HasLifecycleCallbacks]).STOFCEasyAdminBundle, ApiPlatform). Mitigate via:
$eventDispatcher->addListener(..., 0) for highest priority).dmytrof.doctrine.event.* for bundle-specific events).composer require dmytrof/doctrine-modification-events-bundle.config/bundles.php.config/packages/dmytrof_doctrine_modification_events.yaml or via annotations.dmytrof_doctrine_modification_events:
listeners:
App\Entity\User:
- on: [preUpdate, postUpdate]
method: notifyAdminOnChange
service: app.user_listener
autowiring to reduce manual configuration.debug:event-dispatcher to inspect fired events.EventManager logs for lifecycle events.READ COMMITTED).EventDispatcher to log failures.public function onUserUpdate(ModificationEvent $event) {
try {
$this->notifyAdmin($event->getEntity());
} catch (\Throwable $e) {
error_log('Event listener failed: ' . $e->getMessage());
}
}
priority in listener registration.ModificationEvent properties).null values, nested entitiesHow can I help you explore Laravel packages today?