1 | <?php namespace VojtaSvoboda\Reservations\Updates\Classes; |
||
7 | class Seeder extends BaseSeeder |
||
8 | { |
||
9 | /** @var string $seedFileName */ |
||
10 | protected $seedFileName; |
||
11 | |||
12 | /** @var $cache Cache for all objects */ |
||
13 | private $cache; |
||
14 | |||
15 | /** |
||
16 | * Return dummy seed or resources seed. |
||
17 | * |
||
18 | * @param $defaultPath |
||
19 | * |
||
20 | * @return string |
||
21 | * |
||
22 | * @throws Exception |
||
23 | */ |
||
24 | 27 | protected function getSeedFile($defaultPath) |
|
39 | |||
40 | /** |
||
41 | * Get item from cache or from $object reference. |
||
42 | * |
||
43 | * @param string $object |
||
44 | * @param string $key |
||
45 | * @param string $value |
||
46 | * @param bool $createIfNotExists |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | protected function getCached($object, $key, $value, $createIfNotExists = false) |
||
68 | |||
69 | /** |
||
70 | * Get folder, where seed can be overwritten. |
||
71 | * |
||
72 | * - default folder e.g. /plugins/vojtasvoboda/reservations/updates/sources/products.yaml |
||
73 | * - overwritten e.g. /resources/vojtasvoboda/reservations/updates/sources/products.yaml |
||
74 | * |
||
75 | * @param string $defaultPath Default folder path. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | 27 | private function getOverwrittenFilePath($defaultPath) |
|
83 | |||
84 | /** |
||
85 | * Create file from path, save it and return File object |
||
86 | * |
||
87 | * @param string $path File path. |
||
88 | * @param bool $public Should be file public or not? |
||
89 | * |
||
90 | * @return File |
||
91 | */ |
||
92 | protected function getSavedFile($path, $public = true) |
||
101 | } |
||
102 |