1 | <?php |
||
18 | abstract class Report implements ResourceCollectionReport |
||
19 | { |
||
20 | /** |
||
21 | * Status report |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $status = ReportBase::STATUS_NEW; |
||
25 | |||
26 | /** |
||
27 | * Flag update report and not read |
||
28 | * @var bool |
||
29 | */ |
||
30 | protected $isCompleted = false; |
||
31 | |||
32 | /** |
||
33 | * Disk for filesystem |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $disk = 'public'; |
||
37 | |||
38 | /** |
||
39 | * Get file name |
||
40 | * @return string |
||
41 | */ |
||
42 | abstract public function getFilename() : string; |
||
43 | |||
44 | /** |
||
45 | * Get title report |
||
46 | * @return string |
||
47 | */ |
||
48 | abstract public function getTitle() : string; |
||
49 | |||
50 | /** |
||
51 | * Get description report |
||
52 | * @return string |
||
53 | */ |
||
54 | abstract public function getDescription() : string; |
||
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | 2 | public function toArray() : array |
|
72 | |||
73 | /** |
||
74 | * Get path to file |
||
75 | * @return null|string |
||
76 | */ |
||
77 | 2 | public function getPathToFile() : ?string |
|
82 | |||
83 | /** |
||
84 | * Get date last modified file |
||
85 | * @return null|string |
||
86 | */ |
||
87 | 2 | public function getDateLastModified() : ?string |
|
92 | /** |
||
93 | * Get full class name |
||
94 | * @return string |
||
95 | */ |
||
96 | 2 | public function getNameClass() : string |
|
100 | |||
101 | /** |
||
102 | * Change is completed |
||
103 | * @param bool $flag |
||
104 | */ |
||
105 | 1 | public function changeCompleted(bool $flag) : void |
|
109 | |||
110 | /** |
||
111 | * @return bool |
||
112 | */ |
||
113 | 1 | public function getCompleted() : bool |
|
117 | /** |
||
118 | * Change status state report |
||
119 | * @param string $status |
||
120 | */ |
||
121 | 2 | public function changeStatus(string $status) : void |
|
125 | |||
126 | /** |
||
127 | * Get Model Report |
||
128 | * @return Model |
||
129 | */ |
||
130 | 3 | public function getReportModel() : Model |
|
134 | /** |
||
135 | * Get builder two parts string : |
||
136 | * Filename |
||
137 | * Extension |
||
138 | * @return string |
||
139 | */ |
||
140 | 3 | public function getFileNormalize() : string |
|
144 | |||
145 | /** |
||
146 | * @return array |
||
147 | */ |
||
148 | 2 | public function getListNotifications() : array |
|
155 | |||
156 | /** |
||
157 | * Send notification |
||
158 | */ |
||
159 | 2 | public function send() : void |
|
165 | } |
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: