Fix deprecated calls for symfony2.2