Created
November 8, 2016 19:13
-
-
Save bitwombat/03e15436760f9a4a4d4f20968d2d0c6c to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// bootstrap.php | |
use Doctrine\ORM\Tools\Setup; | |
use Doctrine\ORM\EntityManager; | |
require_once "vendor/autoload.php"; | |
// Create a simple "default" Doctrine ORM configuration for Annotations | |
$isDevMode = true; | |
echo __DIR__."/module/UfAdminLibraryModule/src/"; | |
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/module/UfAdminLibraryModule/src/"), $isDevMode); | |
// database configuration parameters | |
$conn = array( | |
'driver' => 'pdo_mysql', | |
'host' => 'localhost', | |
'port' => '3306', | |
'user' => 'uf', | |
'password' => '2304FJKS', | |
'dbname' => 'under', | |
); | |
// obtaining the entity manager | |
$entityManager = EntityManager::create($conn, $config); | |
//$school = new School; | |
$connection = $entityManager->getConnection(); | |
$dbPlatform = $connection->getDatabasePlatform(); | |
$dbPlatform->registerDoctrineTypeMapping('enum', 'string'); | |
$entityManager->find('\Uf\Admin\Entity\School', 1); | |
//$entityManager->getRepository('\Uf\Admin\Entity\Staff'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment