Skip to content

Instantly share code, notes, and snippets.

@bitwombat
Created November 8, 2016 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitwombat/03e15436760f9a4a4d4f20968d2d0c6c to your computer and use it in GitHub Desktop.
Save bitwombat/03e15436760f9a4a4d4f20968d2d0c6c to your computer and use it in GitHub Desktop.
<?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