compatibility symfony 2.6
Strict equality doesn't work when compaing an object to a string