Just Another Doctrine2 Extension
<?php
// MySQL database configuration
$connectionOptions = [
'default' => [
'driver' => 'pdo_mysql',
'dbname' => 'example_db',
'host' => 'localhost',
'user' => 'root',
'password' => '',
'prefix' => '',
],
];
// Application/Doctrine configuration
$applicationOptions = [
'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();
Now supporting PHP 7.3 (Doctrine 2.6.3 or above)
Changed method name validateData to executeValidation, to prevent collisions with an attribute $data in the validated class (thx Peter R).