2017 © Pedro Peláez
 

library doctrine-functions

Doctrine DQL Functions for Mysql

image

luxifer/doctrine-functions

Doctrine DQL Functions for Mysql

  • Thursday, December 21, 2017
  • by luxifer
  • Repository
  • 9 Watchers
  • 74 Stars
  • 496,359 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 12 Forks
  • 2 Open issues
  • 15 Versions
  • 4 % Grown

The README.md

Doctrine Functions

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads, (*1)

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

  • 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., (*3)

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., (*4)

Installation

Just add the package to your composer.json, (*5)

{
    "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., (*6)

<?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., (*7)

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

The Versions

21/12 2017

dev-master

9999999-dev http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

21/12 2017

1.6.0

1.6.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

10/04 2017

1.5.0

1.5.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

09/11 2015

1.4.0

1.4.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

09/09 2015

1.3.2

1.3.2.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

02/09 2015

1.3.1

1.3.1.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

11/08 2015

1.3.0

1.3.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

01/02 2015

1.2.5

1.2.5.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

18/08 2014

1.2.4

1.2.4.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

18/05 2014

1.2.3

1.2.3.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

05/05 2014

1.2.2

1.2.2.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

04/03 2014

1.2.1

1.2.1.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

17/02 2014

1.2.0

1.2.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

12/02 2014

1.1.0

1.1.0.0 http://luxifer.github.io/doctrine-functions/

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

The Development Requires

database mysql dql

25/05 2013

1.0.0

1.0.0.0

Doctrine DQL Functions for Mysql

  Sources   Download

MIT

The Requires

 

database mysql dql