Description

This function returns the data of a document.

Usage

$doc_data = tp_documents::get_document($doc_id, $output_type);

Parameters

doc_id

(int) The ID of the document.

output_type (optional)

(string) You can choice between:

  • OBJECT 
  • ARRAY_A (default)
  • ARRAY_N

Return

(array or object)

An array or object containing all the document fields (doc_id, name, path, size, added,sort,course_id).

Example

$document = tp_documents::get_document(12, ARRAY_A);

Changelog

  • Since: 5.0.0