1 | <?php |
||
12 | class YamlEntityExtractor extends AbstractFolderExtrator implements ExtractorInterface |
||
13 | { |
||
14 | /** |
||
15 | * List of entities to extract |
||
16 | * [ |
||
17 | * 'entity_code' => 'Model Classname' |
||
18 | * ] |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $entitiesToProcess; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $entities = []; |
||
27 | |||
28 | /** |
||
29 | * @var PropertyAccessor |
||
30 | */ |
||
31 | protected $accessor; |
||
32 | |||
33 | public function __construct() |
||
37 | |||
38 | /** |
||
39 | * @param string $entityType |
||
40 | * @param string$entityClass |
||
41 | * @param function $identifierCallback |
||
42 | * @return $this |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | public function addEntityToProcess($entityType, $entityClass, $identifierCallback) |
||
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | public function extract() |
||
81 | |||
82 | protected function check() |
||
90 | |||
91 | /** |
||
92 | * @param string $filename |
||
93 | */ |
||
94 | protected function processFile($filename) |
||
107 | |||
108 | /** |
||
109 | * @param string $entityType |
||
110 | * @param array $data |
||
111 | * @return mixed |
||
112 | * @throws \Exception |
||
113 | */ |
||
114 | protected function processObject($entityType, array $data) |
||
135 | |||
136 | /** |
||
137 | * @param string $identifier |
||
138 | * @return mixed |
||
139 | * @throws \Exception |
||
140 | */ |
||
141 | protected function getEntity($identifier) |
||
152 | } |
||
153 |