1 | <?php |
||
23 | class File |
||
24 | { |
||
25 | private $file; |
||
26 | |||
27 | private $format_name; |
||
28 | |||
29 | /** |
||
30 | * \brief Fill this object with another file. |
||
31 | * @param string $file File_id or local/remote path to the file. |
||
32 | * @param string $format_name Format name of the file (audio, document, ...) |
||
33 | */ |
||
34 | 7 | public function init(string $file, string $format_name) |
|
39 | |||
40 | /** |
||
41 | * \brief (<i>Internal</i>) Check if the path to the file given is local or a file_id/url. |
||
42 | * @return bool True if the file is a local path. |
||
43 | */ |
||
44 | 7 | public function is_local() : bool |
|
56 | |||
57 | /** |
||
58 | * \brief (<i>Internal</i>) Get string component of this file. |
||
59 | * @return string File as string (file_id/path to the file). |
||
60 | */ |
||
61 | 4 | public function getString() |
|
65 | |||
66 | 3 | public function getResource() |
|
76 | |||
77 | 7 | public function getFormatName() : string |
|
81 | } |
||
82 |