Doctrine\ORM\Tools\SchemaTool::__construct PHP Method

__construct() public method

Initializes a new SchemaTool instance that uses the connection of the provided EntityManager.
public __construct ( EntityManager $em )
$em Doctrine\ORM\EntityManager
    public function __construct(EntityManager $em)
    {
        $this->_em = $em;
        $this->_platform = $em->getConnection()->getDatabasePlatform();
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(EntityManagerInterface $em)
 {
     $this->em = $em;
     $this->platform = $this->getConnection()->getDatabasePlatform();
     parent::__construct($em);
 }