morontt/doctrine-functions
Composer 安装命令:
composer require morontt/doctrine-functions
包简介
Additional DQL functions for Doctrine2
关键字:
README 文档
README
Additional DQL functions for Doctrine2
Numeric functions
RAND()ref
Datetime functions
MONTH()ref
String functions
substr(string, from, count)ref
Installation
Just add the package to your composer.json
{
"require": {
"morontt/doctrine-functions": "dev-master"
}
}
Integration
1) Doctrine Only
According to the Doctrine documentation you can register the functions in this package this way.
<?php $config = new \Doctrine\ORM\Configuration(); $config->addCustomNumericFunction('rand', 'Morontt\DQL\Numeric\Rand'); ?>
2) Using Symfony 2
With symfony 2 you can register you functions in the config.yml file.
doctrine: orm: entity_managers: default: dql: numeric_functions: rand: Morontt\DQL\Numeric\Rand datetime_functions: month: Morontt\DQL\DateTime\Month string_functions: substr: Morontt\DQL\String\Substr
统计信息
- 总下载量: 3.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-03