网站管理员/doctrine-extensions

6.0.0 2019-09-08 13:21 UTC

README

Webmasters Doctrine Extensions

又一个 Doctrine2 扩展

引导

<?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();

变更日志

2019-09-08

现在支持 PHP 7.3 (Doctrine 2.6.3 或更高版本)

2019-06-08

将方法名称 validateData 改为 executeValidation,以避免与验证类中的属性 $data 冲突(感谢 Peter R)。