Doctrine\ORM\EntityManager::getConnection PHP Méthode

getConnection() public méthode

Gets the database connection object used by the EntityManager.
public getConnection ( ) : Doctrine\DBAL\Connection
Résultat Doctrine\DBAL\Connection
    public function getConnection()
    {
        return $this->conn;
    }

Usage Example

 public function __construct(EntityManager $enm, Writer $logger)
 {
     $this->evm = $enm->getEventManager();
     //Unused, for now
     $this->enm = $enm;
     $this->logger = $logger;
     $this->connection = $enm->getConnection();
     $enm->getConnection()->getConfiguration()->setSQLLogger($this);
 }
All Usage Examples Of Doctrine\ORM\EntityManager::getConnection