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

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

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

luxifer/doctrine-functions

最新稳定版本:1.7.1

Composer 安装命令:

composer require luxifer/doctrine-functions

包简介

Doctrine DQL Functions for Mysql

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads

This package contains doctrine functions, you can contribute by forking it and propose pull request with your own functions. List of available functions:

  • DATE(expr)
  • DATEDIFF(expr1, expr2)
  • DAYOFWEEK(expr)
  • WEEK(expr)
  • DAY(expr)
  • DAYOFMONTH(expr)
  • DAYOFYEAR(expr)
  • HOUR(expr)
  • MINUTE(expr)
  • MONTH(expr)
  • QUARTER(expr)
  • SECOND(expr)
  • TIME(expr)
  • YEAR(expr)
  • CONVERT_TZ(expr, 'from_tz', 'to_tz') (MySQL)
  • DATE_FORMAT(expr, 'format') (MySQL)
  • CONCAT_WS(separator, str1, str2, ...) (MySQL)
  • RAND() (MySQL)
  • MD5(expr) (MySQL, Postgres)
  • FROM_UNIXTIME(expr1, expr2) (MySQL)

Edit this file in your pull request to add your functions to the list.

Requirements

This library is expected to work with PHP >= 5.3, but you should consider to upgrade to PHP >= 7.0. To contribute to this library you must have PHP >= 7.0 to run the test suite.

Installation

Just add the package to your composer.json

{
    "require": {
        "luxifer/doctrine-functions": "^1.5"
    }
}

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->addCustomDatetimeFunction('date', 'Luxifer\DQL\Datetime\Date');

$em = EntityManager::create($dbParams, $config);

2) Using Symfony 2

With Symfony 2 you can register your functions directly in the config.yml file.

doctrine:
    orm:
        entity_managers:
            default:
                dql:
                    datetime_functions:
                        date:     Luxifer\DQL\Datetime\Date
                        datediff: Luxifer\DQL\Datetime\DateDiff
                        # etc

统计信息

  • 总下载量: 2.4M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 90
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 88
  • Watchers: 7
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固