PHPackages                             mar/doctrine-xtensions - 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. mar/doctrine-xtensions

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

mar/doctrine-xtensions
======================

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

v1.1.5(7y ago)09BSD-3-ClausePHPPHP &gt;=5.4

Since May 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/igtp/DoctrineExtensions)[ Packagist](https://packagist.org/packages/mar/doctrine-xtensions)[ RSS](/packages/mar-doctrine-xtensions/feed)WikiDiscussions master Synced 2d ago

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

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

[](#doctrineextensions)

[![Build Status](https://camo.githubusercontent.com/3fa4dd6b22d6ba39b4a6124ce262c7035f01b66bbcdce677bdbdb53665592249/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6272616e63682d6d61737465722d626c75652e737667)](https://github.com/beberlei/DoctrineExtensions/tree/master)[![Build Status](https://camo.githubusercontent.com/38676c8158971fbae05a694bd062f076987e52195faad5e6891ce7b6e24c3a2d/68747470733a2f2f7472617669732d63692e6f72672f62656265726c65692f446f637472696e65457874656e73696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/beberlei/DoctrineExtensions)[![Packagist](https://camo.githubusercontent.com/f1303db19ef449b74edee1458b1b24fefce850efb3a95fc836b95d29c643ea8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656265726c65692f446f637472696e65457874656e73696f6e732e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/beberlei/DoctrineExtensions)[![Packagist](https://camo.githubusercontent.com/77fc6d9ed23f26a41b329e4f7ab84196e165831937582e4488aa54ac5b3a5d00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f62656265726c65692f446f637472696e65457874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/beberlei/DoctrineExtensions)[![Packagist](https://camo.githubusercontent.com/164c2be2f6fd6aa1c6c4ef7407c7f66c0e5f480f86482c6f527efa32ff8b8d91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f62656265726c65692f446f637472696e65457874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/beberlei/DoctrineExtensions)[![Packagist](https://camo.githubusercontent.com/ac3d02bea1bd7fa6c113f2fbbe1be33d11c78750a430a19f678a08d86fd91f4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62656265726c65692f446f637472696e65457874656e73696f6e732e7376673f6c6162656c3d254532254143253837)](https://packagist.org/packages/beberlei/DoctrineExtensions)

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

DBFunctionsMySQL`ACOS, AES_DECRYPT, AES_ENCRYPT, ANY_VALUE, ASCII, ASIN, ATAN, ATAN2, BINARY, BIT_COUNT, BIT_XOR, CAST, CEIL, CHAR_LENGTH, COLLATE, CONCAT_WS, 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, 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, LAST_DAY, LEAST, LOG, LOG10, LOG2, LPAD, MATCH, MD5, MINUTE, MONTH, MONTHNAME, NOW, NULLIF, 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, UNHEX, UNIX_TIMESTAMP, UTC_TIMESTAMP, UUID_SHORT, VARIANCE, WEEK, WEEKDAY, YEAR, YEARMONTH, YEARWEEK`Oracle`DAY, LISTAGG, MONTH, NVL, TO_CHAR, TO_DATE, TRUNC, YEAR`Sqlite`DATE, MINUTE, HOUR, DAY, WEEK, WEEKDAY, MONTH, YEAR, STRFTIME, DATE_FORMAT*, CASE WHEN THEN ELSE END, IFNULL, REPLACE, ROUND`PostgreSQL`TO_DATE, TO_CHAR, AT_TIME_ZONE, COUNT_FILTER, STRING_AGG`> 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 beberlei/DoctrineExtensions

```

If you want to run phpunit:

```
make test

```

If you want to run php-cs-fixer:

```
make fix  # (or make lint for a dry-run)
```

Usage
-----

[](#usage)

If you are using DoctrineExtensions with Symfony, you should read their documentation on [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:

```
