1 | <?php |
||
8 | class Backup_Status { |
||
9 | |||
10 | private $filename = ''; |
||
11 | |||
12 | public function __construct( $id ) { |
||
15 | |||
16 | public function start( $backup_filename, $status_message ) { |
||
20 | |||
21 | public function get_backup_filename() { |
||
33 | |||
34 | public function is_started() { |
||
37 | |||
38 | public function finish() { |
||
44 | |||
45 | /** |
||
46 | * Get the status of the running backup. |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function get_status() { |
||
65 | |||
66 | /** |
||
67 | * Set the status of the running backup |
||
68 | * |
||
69 | * @param string $message |
||
70 | * |
||
71 | * @return null |
||
72 | */ |
||
73 | public function set_status( $message ) { |
||
89 | |||
90 | /** |
||
91 | * Get the time that the current running backup was started |
||
92 | * |
||
93 | * @return int $timestamp |
||
94 | */ |
||
95 | public function get_start_time() { |
||
110 | |||
111 | /** |
||
112 | * Get the path to the backup running file that stores the running backup status |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function get_status_filepath() { |
||
119 | |||
120 | } |
||
121 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: