1 | <?php |
||
11 | class ValidateSchemaService |
||
12 | { |
||
13 | /** @var RegistryInterface */ |
||
14 | protected $doctrine; |
||
15 | |||
16 | /** @var KernelInterface */ |
||
17 | protected $kernel; |
||
18 | |||
19 | /** @var array */ |
||
20 | protected $excludedEntities = array(); |
||
21 | |||
22 | /** @var array */ |
||
23 | protected $excludedProperties = array(); |
||
24 | |||
25 | /** @var string[] */ |
||
26 | protected $mappingPaths = []; |
||
27 | |||
28 | /** |
||
29 | * Messages from Doctrine\ORM\Tools\SchemaValidator |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $schemaValidatorMessages = array( |
||
34 | 'The field \'%s\' ', |
||
35 | 'The field %s ', |
||
36 | 'The association %s ', |
||
37 | 'Cannot map association \'%s\' ', |
||
38 | 'The mappings %s and ', |
||
39 | 'If association %s ' |
||
40 | ); |
||
41 | |||
42 | /** |
||
43 | * @param RegistryInterface $doctrine |
||
44 | * @param KernelInterface $kernel |
||
45 | */ |
||
46 | public function __construct(RegistryInterface $doctrine, KernelInterface $kernel) |
||
51 | |||
52 | /** |
||
53 | * @param array $excludes |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function setExcludes(array $excludes) |
||
71 | |||
72 | /** |
||
73 | * @param string $path |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function addMappingPath($path) |
||
84 | |||
85 | /** |
||
86 | * @param string $bundle |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function addMappingBundle($bundle) |
||
99 | |||
100 | /** |
||
101 | * @throws InvalidMappingException |
||
102 | */ |
||
103 | public function assertSchemaIsValid() |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | protected function getLastMappingValidateFilePath() |
||
125 | |||
126 | /** |
||
127 | * @return bool |
||
128 | */ |
||
129 | protected function needValidate() |
||
148 | |||
149 | /** |
||
150 | * @return $this |
||
151 | */ |
||
152 | protected function saveLastValidateTimestamp() |
||
163 | |||
164 | /** |
||
165 | * @return int |
||
166 | */ |
||
167 | protected function getLastValidateTimestamp() |
||
173 | |||
174 | /** |
||
175 | * @param string $managerName |
||
176 | * @param string $entityName |
||
177 | * @param array $errors |
||
178 | * @return $this |
||
179 | * @throws InvalidMappingException |
||
180 | */ |
||
181 | protected function assertAuthorizedMappingErrors($managerName, $entityName, array $errors) |
||
200 | } |
||
201 |