/**
  * Return an instance of this class.
  * 
  * @since    1.0.0
  * 
  * @return   object
  */
 public static function get_instance()
 {
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Handle filtering of data, sorting, pagination, and any other data manipulation prior to rendering.
  * 
  * @since    1.0.0
  * 
  * @return   void
  */
 public function prepare_items()
 {
     // Option defaults
     $filter = array();
     $include_id = false;
     $search_terms = false;
     $sort = 'DESC';
     // Set current page
     $page = $this->get_pagenum();
     // Set per page from the screen options
     $per_page = $this->get_items_per_page(str_replace('-', '_', "{$this->screen->id}_per_page"));
     // Sort order
     if (!empty($_REQUEST['order']) && $_REQUEST['order'] != 'desc') {
         $sort = 'ASC';
     }
     // Filter
     //if ( ! empty( $_REQUEST ) )
     // Search
     if (!empty($_REQUEST['s'])) {
         $search_terms = $_REQUEST['s'];
     }
     $controller_user = DLN_Class_Controller_User::get_instance();
     $users = $controller_user->get_users(array('filter' => $filter, 'in' => $include_id, 'page' => $page, 'per_page' => $per_page, 'search_terms' => $search_terms, 'sort' => $sort));
     $new_users = array();
     foreach ($users['users'] as $user_item) {
         $new_users[] = (array) $user_item;
     }
     // Set raw data to display
     $this->items = $new_users;
     // Store information needed for handling table pagination.
     $this->set_pagination_args(array('per_page' => $per_page, 'total_items' => $users['total'], 'total_pages' => ceil($users['total'] / $per_page)));
 }