appventus/extradoctrine-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

This Bundle include Extra Features for doctrine

dev-master 2014-03-27 10:52 UTC

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\')');