column_show = $column_show; $this->column_order = $column_order; $this->doc_filter = $doc_filter; parent::__construct( $tableName, null, null, $column, $itemsPerPage, $direction ); $this->table_data = $data; } /** * Get table data to show on current page. * * @see SortableTable#get_table_data */ public function get_table_data( $from = 1, $per_page = null, $column = null, $direction = null, $sort = true ) { $table = TableSort::sort_table_config( $this->table_data, $this->column, $this->direction === 'ASC' ? SORT_ASC : SORT_DESC, $this->column_show, $this->column_order, SORT_REGULAR, $this->doc_filter ); // return array_slice($table, $from, $this->per_page); return $table; } /** * Get total number of items. * * @see SortableTable#get_total_number_of_items */ public function get_total_number_of_items() { if (isset($this->total_number_of_items) && !empty($this->total_number_of_items)) { return $this->total_number_of_items; } else { if (!empty($this->table_data)) { return count($this->table_data); } return 0; } } }