1 | <?php |
||
8 | class Backup_Status { |
||
9 | |||
10 | public function __construct( $id ) { |
||
13 | |||
14 | public function start( $backup_filename, $status_message ) { |
||
18 | |||
19 | public function get_backup_filename() { |
||
31 | |||
32 | public function is_started() { |
||
35 | |||
36 | public function finish() { |
||
42 | |||
43 | /** |
||
44 | * Get the status of the running backup. |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function get_status() { |
||
64 | |||
65 | /** |
||
66 | * Set the status of the running backup |
||
67 | * |
||
68 | * @param string $message |
||
69 | * |
||
70 | * @return null |
||
71 | */ |
||
72 | public function set_status( $message ) { |
||
83 | |||
84 | /** |
||
85 | * Get the time that the current running backup was started |
||
86 | * |
||
87 | * @return int $timestamp |
||
88 | */ |
||
89 | public function get_start_time() { |
||
104 | |||
105 | /** |
||
106 | * Get the path to the backup running file that stores the running backup status |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function get_status_filepath() { |
||
113 | |||
114 | } |
||
115 |
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: