Created
January 22, 2018 08:53
-
-
Save shahroznawaz/6a3cbb2b4d472242638f7b22e6281553 to your computer and use it in GitHub Desktop.
User Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserController extends Controller | |
{ | |
public function indexAction() | |
{ | |
// All 3 return the "default" entity manager | |
$em = $this->getDoctrine()->getManager(); | |
$em = $this->getDoctrine()->getManager('default'); | |
$em = $this->get('doctrine.orm.default_entity_manager'); | |
// Both of these return the "database2" entity manager | |
$anotherEm = $this->getDoctrine()->getManager('database2'); | |
$anotherEm = $this->get('doctrine.orm.database2_entity_manager'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment