morontt/doctrine-functions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

morontt/doctrine-functions

Composer 安装命令:

composer require morontt/doctrine-functions

包简介

Additional DQL functions for Doctrine2

README 文档

README

Additional DQL functions for Doctrine2

Numeric functions

Datetime functions

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-03