DQL below generates an error:[Syntax Error] line 0, col 42: Error: Expected known function, got 'sha1'
Any way of using SHA1?
public function findIdByDql($hashId)
{
$em = $this->getEntityManager();
$query = $em->createQuery('DELETE FROM CarBrandBundle:Brands b WHERE sha1(b.id) = :id')
->setParameter('id', $hashId)
->execute();
return;
}
You need to create your own function which will translate
sha1
function.Your
app/config/config.yml
file:Your
src/YourBundle/DQL/Sha.php
file:Check doc for more info