Exemple #1
0
 /**
  * @param Connection $connection
  *
  * @return string
  */
 protected function getPrefix(Connection $connection)
 {
     $params = $connection->getParams();
     return array_get($params, 'prefix');
 }
Exemple #2
0
 private function createAB(Connection $abConn)
 {
     // set default orm to the application box
     $this->app['orm.ems.default'] = $this->app['hash.dsn']($this->app['db.dsn']($abConn->getParams()));
     $metadata = $this->app['orm.em']->getMetadataFactory()->getAllMetadata();
     if (!empty($metadata)) {
         // Create SchemaTool
         $tool = new SchemaTool($this->app['orm.em']);
         // Create schema
         $tool->dropSchema($metadata);
         $tool->createSchema($metadata);
     }
     $this->app->getApplicationBox()->insert_datas($this->app);
 }
 /**
  * @param Connection $connection
  *
  * @return string
  */
 protected function getPrefix(Connection $connection)
 {
     $params = $connection->getParams();
     return isset($params['prefix']) ? $params['prefix'] : null;
 }