naprstek / doctrine-functions
A set of User Defined Functions to Doctrine 2, basically for MSSQL.
Installs: 26 077
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
- doctrine/doctrine-orm-module: ^1.1
- phpunit/phpunit: ^6.5
- symfony/yaml: ^4.0
This package is not auto-updated.
Last update: 2025-03-13 18:39:52 UTC
README
A set of extensions to Doctrine 2 that add support for additional query functions available in MSSQL.
This library is inspired by DoctrineExpressions, see here: [https://github.com/beberlei/DoctrineExtensions]. It contains a lot of functions for other DB.
The namespace were preserved as they are in DoctrineExtensions, so those two library can be used together.
DB | Functions |
---|---|
MSSQL | CAST, FORMAT, ISNULL, GETDATE, MONTH, YEAR, DATEPART |
Installation
To install this library, run the command below and you will get the latest version:
composer require naprstek/doctrine-functions
Integration to application
in module.config.php add to doctrine section and name function you need. Functions are not added automaticaly (to decrease dependencies and speed up):
'doctrine' => [ 'connection' => [ 'orm_default' => [ ... ], ], 'configuration' => [ 'orm_default' => [ //User Defined Functions 'string_functions' => [ 'format' => 'DoctrineFunctions\Query\Mssql\Format', ... ], 'datetime_functions' => [], //when they exist 'numeric_functions' => [], //when they exist ], ], ],