### Enable Specific Extensions - XML
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
XML configuration to enable specific Doctrine extensions for ORM entity managers. This example shows enabling 'tree' for 'default' and 'timestampable' for 'other'.
```xml
```
--------------------------------
### Default Configuration - XML
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
XML equivalent of the default configuration, setting the default locale and configuring ORM and MongoDB managers.
```xml
```
--------------------------------
### Default Configuration - YAML
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
Sets the default locale and configures the uploadable extension with default paths and classes. Also includes basic ORM and MongoDB configurations.
```yaml
stof_doctrine_extensions:
default_locale: en_US
# Only used if you activated the Uploadable extension
uploadable:
# Default file path: This is one of the three ways you can configure the path for the Uploadable extension
default_file_path: "%kernel.project_dir%/public/uploads"
# Mime type guesser class: Optional. By default, we provide an adapter for the one present in the Mime component of Symfony
mime_type_guesser_class: Stof\DoctrineExtensionsBundle\Uploadable\MimeTypeGuesserAdapter
# Default file info class implementing FileInfoInterface: Optional. By default we provide a class which is prepared to receive an UploadedFile instance.
default_file_info_class: Stof\DoctrineExtensionsBundle\Uploadable\UploadedFileInfo
orm:
default: ~
mongodb:
default: ~
```
--------------------------------
### Activate extensions for entity managers
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
Enable specific extensions for your entity managers within the bundle configuration.
```yaml
# app/config/config.yml
```
--------------------------------
### Enable Specific Extensions - YAML
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
Enables specific Doctrine extensions for the 'default' and 'other' ORM entity managers. Note that listeners are not enabled by default.
```yaml
# app/config/config.yml
# (or config/packages/stof_doctrine_extensions.yaml)
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
tree: true
timestampable: false # not needed: listeners are not enabled by default
translatable: false
blameable: false
sluggable: false
loggable: false
ip_traceable: false
sortable: false
softdeleteable: false
uploadable: false
reference_integrity: false
other:
timestampable: true
```
--------------------------------
### Register Doctrine extension mappings
Source: https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html
Register the mapping for extensions like Translatable, Translator, Loggable, and Tree in your Doctrine configuration.
```yaml
# app/config/config.yml
# (or config/packages/doctrine.yaml)
doctrine:
orm:
entity_managers:
default:
mappings:
gedmo_translatable:
type: attribute
prefix: Gedmo\Translatable\Entity
dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Translatable/Entity"
alias: GedmoTranslatable # (optional) it will default to the name set for the mapping
is_bundle: false
gedmo_translator:
type: attribute
prefix: Gedmo\Translator\Entity
dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Translator/Entity"
alias: GedmoTranslator # (optional) it will default to the name set for the mapping
is_bundle: false
gedmo_loggable:
type: attribute
prefix: Gedmo\Loggable\Entity
dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Loggable/Entity"
alias: GedmoLoggable # (optional) it will default to the name set for the mapping
is_bundle: false
gedmo_tree:
type: attribute
prefix: Gedmo\Tree\Entity
dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Tree/Entity"
alias: GedmoTree # (optional) it will default to the name set for the mapping
is_bundle: false
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.