![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
Represent a document. More...
Public Member Functions | |
| __construct ($data=null, $mime_type=null) | |
| Construct new document instance. | |
| set_content ($data, $mime_type=null) | |
| Define document content and mime-type. | |
| set_content_from_file ($filename, $mime_type=null) | |
| Define document content for existing file and mime-type. | |
| is_valid () | |
| Check whether document is valid. | |
| get_filename () | |
| Retrieve document filename. | |
| get_mime_type () | |
| Retrieve the mime-type of the document. | |
Represent a document.
This document can be sent to Antidot component such as PaF through Antidot Back Office APIs.
| __construct | ( | $data = null, |
|
$mime_type = null |
|||
| ) |
Construct new document instance.
Newly created document can be empty and filled later on, or filled with appropriate content.
| $data | [in] string corresponding to the content of the created document (default: null, document is not initialized). |
| $mime_type | [in] mime-type of the document (default: null). If not set mime-type will be automatically detected. |
| InvalidArgumentException | when data is not a string. |
| get_filename | ( | ) |
Retrieve document filename.
When the document is initialized with string data, temporary file is created. It is automatically removed at the end of the script.
| get_mime_type | ( | ) |
Retrieve the mime-type of the document.
| is_valid | ( | ) |
Check whether document is valid.
| set_content | ( | $data, | |
$mime_type = null |
|||
| ) |
Define document content and mime-type.
| $data | [in] new document content. |
| $mime_type | [in] mime-type of the document (default: null). If not set mime-type will be automatically detected. |
| InvalidArgumentException | when data is not a string. |
| set_content_from_file | ( | $filename, | |
$mime_type = null |
|||
| ) |
Define document content for existing file and mime-type.
| $filename | [in] Name of the file to use as document. |
| $mime_type | [in] mime-type of the document (default: null). If not set mime-type will be automatically detected. |
| RuntimeException | when provided filename does not exist. |
1.8.1.2