public function __construct() { global $bp; //the parent category id is used sometimes used in post_logic, but always in category_logic so we get it first $this->parent_id = self::get_parent_category_id(); $this->do_post_logic(); $this->do_url_logic(); $this->do_category_logic(); $this->do_sorting_logic(); $this->do_paging_logic(); $this->document_list = BP_Group_Documents::get_list_by_group($bp->groups->current_group->id, $this->category, $this->sql_sort, $this->sql_order, $this->start_record, $this->items_per_page); }
/** * bp_group_documents_remove_data() * * Cleans out both the files and the database records when a group is deleted */ function bp_group_documents_remove_data($group_id) { $results = BP_Group_Documents::get_list_by_group($group_id); if (count($results) >= 1) { foreach ($results as $document_params) { $document = new BP_Group_Documents($document_params['id'], $document_params); $document->delete(); do_action('bp_group_documents_delete_with_group', $document); } } }