1 | <?php |
||
23 | class Folder extends File { |
||
24 | |||
25 | private static $singular_name = "Folder"; |
||
26 | |||
27 | private static $plural_name = "Folders"; |
||
28 | |||
29 | public function exists() { |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | */ |
||
36 | public function populateDefaults() { |
||
43 | |||
44 | /** |
||
45 | * Find the given folder or create it as a database record |
||
46 | * |
||
47 | * @param string $folderPath Directory path relative to assets root |
||
48 | * @return Folder|null |
||
49 | */ |
||
50 | public static function find_or_make($folderPath) { |
||
84 | |||
85 | public function onBeforeDelete() { |
||
92 | |||
93 | /** |
||
94 | * Return the relative URL of an icon for this file type |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getIcon() { |
||
101 | |||
102 | /** |
||
103 | * Override setting the Title of Folders to that Name and Title are always in sync. |
||
104 | * Note that this is not appropriate for files, because someone might want to create a human-readable name |
||
105 | * of a file that is different from its name on disk. But folders should always match their name on disk. |
||
106 | * |
||
107 | * @param string $title |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function setTitle($title) { |
||
114 | |||
115 | /** |
||
116 | * Get the folder title |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getTitle() { |
||
123 | |||
124 | /** |
||
125 | * Override setting the Title of Folders to that Name and Title are always in sync. |
||
126 | * Note that this is not appropriate for files, because someone might want to create a human-readable name |
||
127 | * of a file that is different from its name on disk. But folders should always match their name on disk. |
||
128 | * |
||
129 | * @param string $name |
||
130 | * @return $this |
||
131 | */ |
||
132 | public function setName($name) { |
||
137 | |||
138 | /** |
||
139 | * A folder doesn't have a (meaningful) file size. |
||
140 | * |
||
141 | * @return null |
||
142 | */ |
||
143 | public function getSize() { |
||
146 | |||
147 | /** |
||
148 | * Returns all children of this folder |
||
149 | * |
||
150 | * @return DataList |
||
151 | */ |
||
152 | public function myChildren() { |
||
155 | |||
156 | /** |
||
157 | * Returns true if this folder has children |
||
158 | * |
||
159 | * @return bool |
||
160 | */ |
||
161 | public function hasChildren() { |
||
164 | |||
165 | /** |
||
166 | * Returns true if this folder has children |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | public function hasChildFolders() { |
||
173 | |||
174 | /** |
||
175 | * Return the FieldList used to edit this folder in the CMS. |
||
176 | * You can modify this FieldList by subclassing folder, or by creating a {@link DataExtension} |
||
177 | * and implemeting updateCMSFields(FieldList $fields) on that extension. |
||
178 | * |
||
179 | * @return FieldList |
||
180 | */ |
||
181 | public function getCMSFields() { |
||
197 | |||
198 | /** |
||
199 | * Get the children of this folder that are also folders. |
||
200 | * |
||
201 | * @return DataList |
||
202 | */ |
||
203 | public function ChildFolders() { |
||
206 | |||
207 | /** |
||
208 | * Get the number of children of this folder that are also folders. |
||
209 | * |
||
210 | * @return int |
||
211 | */ |
||
212 | public function numChildFolders() { |
||
215 | /** |
||
216 | * @return string |
||
217 | */ |
||
218 | public function CMSTreeClasses() { |
||
233 | |||
234 | /** |
||
235 | * @return string |
||
236 | */ |
||
237 | public function getTreeTitle() { |
||
243 | |||
244 | public function getFilename() { |
||
247 | |||
248 | /** |
||
249 | * Folders do not have public URLs |
||
250 | * |
||
251 | * @param bool $grant |
||
252 | * @return null|string |
||
253 | */ |
||
254 | public function getURL($grant = true) { |
||
257 | |||
258 | /** |
||
259 | * Folders do not have public URLs |
||
260 | * |
||
261 | * @return string |
||
262 | */ |
||
263 | public function getAbsoluteURL() { |
||
266 | |||
267 | public function onAfterWrite() { |
||
278 | |||
279 | public function onAfterDelete() { |
||
287 | |||
288 | public function updateFilesystem() { |
||
291 | |||
292 | /** |
||
293 | * If a write is skipped due to no changes, ensure that nested records still get asked to update |
||
294 | */ |
||
295 | public function onAfterSkippedWrite() { |
||
298 | |||
299 | /** |
||
300 | * Update filesystem of all children |
||
301 | */ |
||
302 | public function updateChildFilesystem() { |
||
314 | |||
315 | public function StripThumbnail() { |
||
318 | } |
||
319 |
This check looks for accesses to local static members using the fully qualified name instead of
self::
.While this is perfectly valid, the fully qualified name of
Certificate::TRIPLEDES_CBC
could just as well be replaced byself::TRIPLEDES_CBC
. Referencing local members withself::
assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.