$ show stof/StofDoctrineExtensionsBundle
StofDoctrineExtensionsBundle is a Symfony bundle that integrates DoctrineExtensions (gedmo/doctrine-extensions) with Symfony applications. It provides dependency injection configuration, event listeners, and tools for using Doctrine behavioral extensions like Tree, Translatable, Sluggable, Timestampable, Blameable, Loggable, Sortable, Softdeleteable, Uploadable, and Reference Integrity. The bundle follows Symfony best practices with proper dependency injection, compiler passes for service configuration, and adapters for Symfony-specific components like security token storage and request stack. It handles the complex integration between Symfony's service container and Doctrine's event system, allowing developers to easily configure and use Doctrine extensions in their Symfony projects.
The LLM identified 4 files worth highlighting for reuse:
Provides actor (user) information from Symfony's security token storage implementing Gedmo's ActorProviderInterface. Properly handles null token storage and authorization checker cases, returning null when user is not authenticated. Demonstrates clean adapter pattern with dependency injection and interface implementation.
Adapts Symfony's RequestStack to provide client IP address for Gedmo's IpAddressProviderInterface. Safely handles cases where request stack or current request is null. Shows proper encapsulation of Symfony-specific concerns in a reusable adapter.
Adapts Symfony's UploadedFile to Gedmo's FileInfoInterface for use with the Uploadable extension. Implements all required methods by delegating to the underlying UploadedFile object. Solves the common problem of bridging Symfony file uploads with Doctrine extensions.
Compiler pass that conditionally configures the annotation reader for Doctrine extensions. Registers an alias to the existing annotation_reader service if available, otherwise registers Doctrine's AttributeReader directly. Demonstrates good compiler pass pattern for flexible service configuration.