PHPackages                             technoknol/doctrineextensions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. technoknol/doctrineextensions

ActiveLibrary[Database &amp; ORM](/categories/database)

technoknol/doctrineextensions
=============================

A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.

1.3.1(4y ago)09.4k↓36.7%BSD-3-ClausePHPPHP ^7.2 || ^8.0

Since May 16Pushed 4y agoCompare

[ Source](https://github.com/technoknol/DoctrineExtensions)[ Packagist](https://packagist.org/packages/technoknol/doctrineextensions)[ RSS](/packages/technoknol-doctrineextensions/feed)WikiDiscussions development Synced 1mo ago

READMEChangelogDependencies (7)Versions (52)Used By (0)

DoctrineExtensions
==================

[](#doctrineextensions)

[![Build Status](https://camo.githubusercontent.com/bcfa8dea2dba840b2eab15e378203e6810c2059c02cfc48b6a8d1e85478e360f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6272616e63682d646576656c6f706d656e742d626c75652e737667)](https://github.com/technoknol/DoctrineExtensions/tree/development)[![Build Status](https://github.com/technoknol/DoctrineExtensions/workflows/Tests/badge.svg)](https://github.com/technoknol/DoctrineExtensions/actions)[![Packagist](https://camo.githubusercontent.com/1b258554abb7091516a5965e31b8039c17581e7a5c5834b2d1010f614d8fc455/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746563686e6f6b6e6f6c2f646f637472696e65657874656e73696f6e732e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/technoknol/doctrineextensions)[![Packagist](https://camo.githubusercontent.com/e896780db515a3dfe41a6aa763c0e48b59c108a4509d34676dceb5b84c26eb48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f746563686e6f6b6e6f6c2f646f637472696e65657874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/technoknol/doctrineextensions)[![Packagist](https://camo.githubusercontent.com/2050f35f64120e950599cebb3eda62cc863de335313365227f85b9748da4ad4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f746563686e6f6b6e6f6c2f646f637472696e65657874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/technoknol/doctrineextensions)[![Packagist](https://camo.githubusercontent.com/28d93f81fd3591dfea2811543a43c3a105e1aec1f0b4dc999f12ad7215e1c2e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746563686e6f6b6e6f6c2f646f637472696e65657874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/technoknol/doctrineextensions)

*A Fork of `beberlei/doctrineextensions` package.*

A set of extensions to Doctrine 2 that add support for functions available in MySQL, Oracle, PostgreSQL and SQLite.

DBFunctionsMySQL`ACOS, ADDTIME, AES_DECRYPT, AES_ENCRYPT, ANY_VALUE, ASCII, ASIN, ATAN, ATAN2, BINARY, BIT_COUNT, BIT_XOR, CAST, CEIL, CHAR_LENGTH, COLLATE, CONCAT_WS, CONV, CONVERT_TZ, COS, COT, COUNTIF, CRC32, DATE, DATE_FORMAT, DATEADD, DATEDIFF, DATESUB, DAY, DAYNAME, DAYOFWEEK, DAYOFYEAR, DEGREES, DIV, EXP, EXTRACT, FIELD, FIND_IN_SET, FLOOR, FORMAT, FROM_BASE64, FROM_UNIXTIME, GREATEST, GROUP_CONCAT, HEX, HOUR, IFELSE, IFNULL, INET_ATON, INET_NTOA, INET6_ATON, INET6_NTOA, INSTR, IS_IPV4, IS_IPV4_COMPAT, IS_IPV4_MAPPED, IS_IPV6, JSON_CONTAINS, JSON_DEPTH, JSON_LENGTH, LAG, LAST_DAY, LEAD, LEAST, LOG, LOG10, LOG2, LPAD, MAKEDATE, MATCH, MD5, MINUTE, MONTH, MONTHNAME, NOW, NULLIF, OVER, PERIOD_DIFF, PI, POWER, QUARTER, RADIANS, RAND, REGEXP, REPLACE, ROUND, RPAD, SECOND, SECTOTIME, SHA1, SHA2, SIN, SOUNDEX, STD, STDDEV, STRTODATE, STR_TO_DATE, SUBSTRING_INDEX, TAN, TIME, TIMEDIFF, TIMESTAMPADD, TIMESTAMPDIFF, TIMETOSEC, TRUNCATE, UNHEX, UNIX_TIMESTAMP, UTC_TIMESTAMP, UUID_SHORT, VARIANCE, WEEK, WEEKDAY, WEEKOFYEAR, YEAR, YEARMONTH, YEARWEEK`Oracle`CEIL, DAY, FLOOR, HOUR, LISTAGG, MINUTE, MONTH, NVL, SECOND, TO_CHAR, TO_DATE, TRUNC, YEAR`SQLite`CASE WHEN THEN ELSE END, DATE, DATE_FORMAT*, DAY, HOUR, IFNULL, JULIANDAY, MINUTE, MONTH, REPLACE, ROUND, SECOND, STRFTIME, WEEK, WEEKDAY, YEAR`PostgreSQL`AGE, AT_TIME_ZONE, COUNT_FILTER, DATE, DATE_PART, DATE_TRUNC, DAY, EXTRACT, GREATEST, HOUR, LEAST, MINUTE, MONTH, REGEXP_REPLACE, SECOND, STRING_AGG, TO_CHAR, TO_DATE, YEAR`> Note: SQLite date functions are implemented as `strftime(format, value)`. SQLite only supports the [most common formats](https://www.sqlite.org/lang_datefunc.html), so `date_format` will convert the mysql substitutions to the closest available SQLite substitutions. This means `date_format(field, '%b %D %Y') -> Jan 1st 2015` becomes `strftime('%m %d %Y', field) -> 01 01 2015`.

Installation
------------

[](#installation)

To install this library, run the command below and you will get the latest version:

```
composer require technoknol/doctrineextensions

```

If you want to run phpunit:

```
composer run test

```

If you want to run php-cs-fixer:

```
composer run lint
```

Usage
-----

[](#usage)

If you are using DoctrineExtensions with Symfony read [How to Register custom DQL Functions](https://symfony.com/doc/current/doctrine/custom_dql_functions.html).

You can find example Symfony configuration for using DoctrineExtensions custom DQL functions in [config](config).

If you are using DoctrineExtensions standalone, you might want to fire up the autoloader:

```
