webmasters/doctrine-extensions

Doctrine2 extensions

3.0.0 2014-10-30 11:40 UTC

README

Webmasters Doctrine Extensions

Just Another Doctrine2 Extension

Bootstrap

<?php

// MySQL database configuration
$connectionOptions = array(
    'default' => array(
        'driver' => 'pdo_mysql',
        'dbname' => 'example_db',
        'host' => 'localhost',
        'user' => 'root',
        'password' => '',
        'prefix' => '',
    ),
);

// Application/Doctrine configuration
$applicationOptions = array(
    'debug_mode' => true, // in production environment false
);

// Use Composer autoloading
require_once 'vendor/autoload.php';

// Get Doctrine entity manager
$bootstrap = Webmasters\Doctrine\Bootstrap::getInstance(
    $connectionOptions,
    $applicationOptions
);

$em = $bootstrap->getEm();

Idea

Jan Teriete