1 | <?php |
||
23 | class DataManager extends TrackingManager |
||
24 | { |
||
25 | private $dataTransformerManager; |
||
26 | private $configuration; |
||
27 | private $eventDispatcher; |
||
28 | private $logger; |
||
29 | |||
30 | /** |
||
31 | * DataManager constructor. |
||
32 | */ |
||
33 | 2 | public function __construct(DataTransformerManager $dataTransformerManager, Configuration $configuration, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) |
|
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function compileManager() |
||
45 | { |
||
46 | if (!$this->configuration->hasDataItems()) |
||
47 | { |
||
48 | $this->logger->notice('No DataItems or Datasets detected... Ignoring.'); |
||
49 | return; |
||
50 | } |
||
51 | |||
52 | $this->parseDataItems($this->configuration->getDataFolders()); |
||
53 | $this->parseDataSets($this->configuration->getDataSets()); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Get all of the DataItems and DataSets in this manager. |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | 2 | public function &getDataItems() |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getJailedDataItems() |
||
75 | |||
76 | /** |
||
77 | * Loop through all of the DataItems specified in `$folders`. Each folder will have contain just DataItems. |
||
78 | * |
||
79 | * For each folder, supported file type is read, parsed, and made available through `$this->getDataItems()` |
||
80 | * |
||
81 | * @param string[] $folders An array of folders to be searched for to contain DataItems |
||
82 | */ |
||
83 | 1 | public function parseDataItems($folders) |
|
96 | |||
97 | /** |
||
98 | * Loop through all of the DataSets specified in `$dataSets`. Each DataSet contains a name and a folder location. |
||
99 | * |
||
100 | * For each folder, supported file type is read, parsed, and made available through `$this->getDataItems()` |
||
101 | * |
||
102 | * @param string[] $dataSets An array of DataSets |
||
103 | */ |
||
104 | 1 | public function parseDataSets($dataSets) |
|
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | 2 | protected function handleTrackableItem(File $filePath, array $options = []) |
|
166 | } |
||
167 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.