2017 © Pedro Peláez
 

library doctrine-functions

Additional DQL functions for Doctrine2

image

morontt/doctrine-functions

Additional DQL functions for Doctrine2

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

doctrine-functions

Additional DQL functions for Doctrine2, (*1)

Numeric functions

Datetime functions

String functions

  • substr(string, from, count) ref

Installation

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

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

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

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

The Versions

14/10 2016

dev-master

9999999-dev https://github.com/morontt/doctrine-functions

Additional DQL functions for Doctrine2

  Sources   Download

MIT

The Requires

 

database mysql dql