Single page ajax function in core php oops

JQuery.ajax({
  url: 'ajax/Ajaxfunction.php',
  type: 'post',
  data: {
    'function_name': 'dynamicdiscount'
  },
  success: function(result) {
    alert(result);
  }
});

Ajaxfunction.php:

include 'call_function.php'; /* For check function exit or not include from another page */
  class Ajaxfunction
  {
    public function __construct()
    {
      $this->deal = new dealModel();
      $this->user = new userModel();
    }  

    public function test()
    {
      echo $this->user->baseURL();  /* Call function from userModel.php */
    }

    function getProductDiscount()
    {
      $where="id = 1";
      $res = $this->user->getData($where,"table_product");  /* Call function from userModel.php */
      while($row=$res->fetch_assoc())
      {
        $disc = trim($row['discount']);
      }

      echo $disc;
    }
  }

call_function.php: This page for check function exit or not

include 'userModel.php'; /* MySql connection code */

$ajaxfun = new Ajaxfunction();
$function = $_POST["function_name"];  /* this function  name get from ajax body*/

if (is_callable(array($ajaxfun, $function)))
{
  call_user_method($function, $ajaxfun);  /* oops function call with object */
} 
else
{
  echo "Function Not Exists";
}