webonaute/doctrine-mysql-extra

为Doctrine和MYSQL平台提供的一些额外功能。

1.2.2 2022-05-03 16:28 UTC

This package is auto-updated.

Last update: 2024-08-30 01:20:20 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

关于

为Doctrine和MYSQL平台提供的一些额外功能。

发布

  • 使用版本 1.x 用于Doctrine 1.8+。 build status

安装

此包通过 composer 提供,在 packagist 上找到。

运行: composer require webonaute/doctrine-mysql-extra 1.0

文档

Doctrine配置

doctrine:
  dbal:
    default_connection: default
    connections:
      default:
        platform_service: 'Webonaute\DoctrineMysqlExtra\Doctrine\DBAL\Platforms\MySql57Platform'
        server_version: '5.7'
        #platform_service: 'Webonaute\DoctrineMysqlExtra\Doctrine\DBAL\Platforms\MySql80Platform'
        #server_version: '80'
    types:
      numeric: Webonaute\DoctrineMysqlExtra\Doctrine\DBAL\Types\NumericType
      cron_expression: Webonaute\DoctrineMysqlExtra\Doctrine\DBAL\Types\CronExpressionType
  orm:
    entity_managers:
      default:
        dql:
          datetime_functions:
            now: Webonaute\DoctrineMysqlExtra\Doctrine\ORM\Query\Now
            utc_timestamp: Webonaute\DoctrineMysqlExtra\Doctrine\ORM\Query\UtcTimestamp

       

对于symfony用户,请在services.yml中声明要使用的服务。

services:
    Webonaute\DoctrineMysqlExtra\Doctrine\DBAL\Platforms\MySql57Platform: ~

许可证

查看 LICENSE