appventus / extradoctrine-bundle
This Bundle include Extra Features for doctrine
Installs: 2 470
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.0
- symfony/framework-bundle: >=2.3
This package is auto-updated.
Last update: 2021-12-21 22:35:03 UTC
README
This bundle gives extra features to doctrine for symfony2
Configuration
In your doctrine configuration, add the functions:
doctrine:
orm:
dql:
string_functions:
lpad: AppVentus\DoctrineBundle\ORM\Query\AST\Functions\LpadFunction
Usage
Exemple of query builder usage:
//we want to have YYYYMM
//so we need to have 2 digits for month
$zeroFillLiteral = $qb->expr()->literal('2');
$yearMonthConcatExpr = $qb->expr()->concat('bill.year', 'LPAD(bill.month,'.$zeroFillLiteral.',\'0\')');