use depreciated method to be compatible with symfony 2.2