Adapted to Symfony 2.4