zoddo / dateinterval-bundle
此包已被弃用,不再维护。未建议替代包。
Doctrine 日期间隔库的 Symfony 扩展包。
v1.0.0
2015-03-14 22:29 UTC
Requires
- doctrine/orm: >=2.2
- herrera-io/doctrine-dateinterval: dev-master@dev
- symfony/symfony: >=2.1
Requires (Dev)
- phpunit/phpunit: 3.7.*
Replaces
This package is not auto-updated.
Last update: 2022-02-05 03:25:01 UTC
README
Doctrine 日期间隔库的 Symfony 扩展包。
摘要
此包将自动
- 注册
dateinterval
Doctrine 映射类型 - 添加
DATE_INTERVAL
DQL 函数
到默认实体管理器 (doctrine.orm.entity_manager
)。
安装
将其添加到您的 Composer 依赖列表中
$ composer require zoddo/dateinterval-bundle=1.* herrera-io/doctrine-dateinterval=dev-master@dev
将其添加到您的 app/AppKernel.php
文件中
<?php public function registerBundles() { $bundles = array( // ... snip ... new Herrera\Symfony\DateInterval\DateIntervalBundle() // ... snip ... ); }
用法
在您的实体中
<?php class MyEntity { /** * @ORM\Column(type="dateinterval") */ private $interval; }
在您的查询中
SELECT j FROM Jobs j WHERE j.interval < DATE_INTERVAL('PT1H')