1 | <?php |
||
15 | class YamlEntityExtractor extends AbstractFolderExtrator implements ExtractorInterface |
||
16 | { |
||
17 | /** |
||
18 | * List of entities to extract |
||
19 | * [ |
||
20 | * 'entity_code' => 'Model Classname' |
||
21 | * ] |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $entitiesToProcess = []; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $entities = []; |
||
30 | |||
31 | /** |
||
32 | * @var PropertyAccessor |
||
33 | */ |
||
34 | protected $accessor; |
||
35 | |||
36 | 4 | public function __construct() |
|
40 | |||
41 | /** |
||
42 | * @param string $entityType |
||
43 | * @param string$entityClass |
||
44 | * @param function $identifierCallback |
||
45 | * @return $this |
||
46 | * @throws \Exception |
||
47 | */ |
||
48 | 4 | public function addEntityToProcess($entityType, $entityClass, $identifierCallback) |
|
62 | |||
63 | /** |
||
64 | * @inheritDoc |
||
65 | */ |
||
66 | 3 | public function extract() |
|
84 | |||
85 | 3 | protected function check() |
|
93 | |||
94 | /** |
||
95 | * @param $filename |
||
96 | * @throws \Exception |
||
97 | */ |
||
98 | 3 | protected function processFile($filename) |
|
114 | |||
115 | /** |
||
116 | * @param string $entityType |
||
117 | * @param array $data |
||
118 | * @return mixed |
||
119 | * @throws \Exception |
||
120 | */ |
||
121 | 3 | protected function processObject($entityType, array $data) |
|
142 | |||
143 | /** |
||
144 | * @param string $identifier |
||
145 | * @return mixed |
||
146 | * @throws \Exception |
||
147 | */ |
||
148 | 2 | protected function getEntity($identifier) |
|
159 | } |
||
160 |