Skip to content

Instantly share code, notes, and snippets.

@marzocchi
Created September 22, 2012 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marzocchi/3765995 to your computer and use it in GitHub Desktop.
Save marzocchi/3765995 to your computer and use it in GitHub Desktop.
Use ClassMetadata as a service
services:
# Use an entity's ClassMetadata as if it where a service (for example, in
# other services definitions).
#
# See http://symfony.com/doc/2.0/components/dependency_injection/factories.html
foo.foo_class_metadata:
class: "Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata"
factory_service: doctrine.orm.entity_manager
factory_method: getClassMetadata
arguments:
# Fully-qualified entity class name
- "Foo\\Bundle\\FooBundle\\Entity\\Foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment