Removing deprecated function for Symfony2.2