Total Complexity | 3 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class DownloadFolder extends Folder |
||
13 | { |
||
14 | /** |
||
15 | * The location of this folder |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | private static $folder_name = "downloadableproducts"; |
||
20 | |||
21 | /** |
||
22 | * Setup defaults when a dev build is run |
||
23 | * |
||
24 | * @return void |
||
25 | */ |
||
26 | public function requireDefaultRecords() |
||
27 | { |
||
28 | parent::requireDefaultRecords(); |
||
29 | |||
30 | // Setup, or change, the top level download folder. |
||
31 | $download_folder = static::find_or_make(static::config()->folder_name); |
||
32 | $download_folder->ClassName = self::class; |
||
33 | $download_folder->write(); |
||
34 | DB::alteration_message("Setup downloadableproduct folder"); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Ensure this folder has correct permissions |
||
39 | */ |
||
40 | public function onBeforeWrite() |
||
51 | } |
||
52 | } |
||
54 | } |