public function prepare_items() { $this->_column_headers = array($this->get_columns(), $this->get_hidden_columns(), $this->get_sortable_columns()); $args = $this->get_query_args(); $total_items = MS_Model_Invoice::get_invoice_count($args); $this->items = apply_filters('ms_helper_listtable_billing_items', MS_Model_Invoice::get_invoices($args)); $per_page = $this->get_items_per_page('invoice_per_page', self::DEFAULT_PAGE_SIZE); $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page)); }
/** * Get a list of all invoices linked to this relationship * * @since 1.0.0 * @api * * @return MS_Model_Invoice[] List of invoices. */ public function get_invoices() { $invoices = MS_Model_Invoice::get_invoices(array('nopaging' => true, 'meta_query' => array(array('key' => 'ms_relationship_id', 'value' => $this->id)))); return apply_filters('ms_model_relationship_get_invoices', $invoices); }