File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -69,3 +69,26 @@ the default entity manager (i.e. ``default``) is returned::
69
69
You can now use Doctrine just as you did before - using the ``default `` entity
70
70
manager to persist and fetch entities that it manages and the ``customer ``
71
71
entity manager to persist and fetch its entities.
72
+
73
+ The same applies to repository call::
74
+
75
+ class UserController extends Controller
76
+ {
77
+ public function indexAction()
78
+ {
79
+ // Retrieves a repository managed by the "default" em
80
+ $products = $this->get('doctrine')
81
+ ->getRepository('AcmeStoreBundle:Product')
82
+ ->findAll();
83
+
84
+ // Explicit way to deal with the "default" em
85
+ $products = $this->get('doctrine')
86
+ ->getRepository('AcmeStoreBundle:Product', 'default')
87
+ ->findAll();
88
+
89
+ // Retrieves a repository managed by the "customer" em
90
+ $customers = $this->get('doctrine')
91
+ ->getRepository('AcmeCustomerBundle:Customer', 'customer')
92
+ ->findAll();
93
+ }
94
+ }
You can’t perform that action at this time.
0 commit comments