Are there changes to Views functions? I am trying to update a old custom module written for Drupal 7 for Drupal 8. I have used a lot of view functions like views_include() and views_get_view(). Are they all dropped in Drupal 8?

function validate_email($email) {   
    //pass the email to the filter
    views_include('view');  
    $name = 'send_otp';
    $display = 'page_1';
    $alter = array('exposed' =&gt;array('field_email_value' =&gt; $email));
    $view = views_get_view($name);
    $view-&gt;init_display($display);
    $view-&gt;preview=TRUE;
    $view-&gt;is_cacheable = FALSE;    
    if(isset($alter['exposed'])) {
        foreach($alter['exposed'] as $key =&gt; $valor) {
            $view-&gt;exposed_input[$key] = $valor;
        }
    }
    $view-&gt;pre_execute();
    $output = $view-&gt;display_handler-&gt;preview();
    $view-&gt;post_execute();
    //if the result is empty
    if(empty($view-&gt;result)) {
        //return 0
        return 0;
    }
    else {
        //return node id
        return $view-&gt;result[0]-&gt;nid;
    }   
}



  Fatal error:  Call to undefined function views_include() in /var/www/html/mdc-conference-backend/sites/all/modules/custom/rest/sendotp.php on line 
  43
views_get_view became Views::getView, and several others are now static methods on the Views class in the views module.

I don't think views_include is necessary anymore.