https://community.magento.com/t5/Magento-2-x-Programming/Magento-2-Deprecated-Functionality-Function... You can refer this link solution, specially change 3 that will help you