@@ 9-51 (lines=43) @@ | ||
6 | use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
|
7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
|
8 | ||
9 | class ValidateSchemaListener |
|
10 | { |
|
11 | /** @var ValidateSchemaService */ |
|
12 | protected $validateSchema; |
|
13 | ||
14 | /** @var array */ |
|
15 | protected $excludedEntities = array(); |
|
16 | ||
17 | /** @var array */ |
|
18 | protected $excludedProperties = array(); |
|
19 | ||
20 | /** |
|
21 | * Messages from Doctrine\ORM\Tools\SchemaValidator |
|
22 | * |
|
23 | * @var array |
|
24 | */ |
|
25 | protected $schemaValidatorMessages = array( |
|
26 | 'The field \'%s\' ', |
|
27 | 'The field %s ', |
|
28 | 'The association %s ', |
|
29 | 'Cannot map association \'%s\' ', |
|
30 | 'The mappings %s and ', |
|
31 | 'If association %s ' |
|
32 | ); |
|
33 | ||
34 | /** |
|
35 | * @param ValidateSchemaService $validateSchema |
|
36 | */ |
|
37 | public function __construct(ValidateSchemaService $validateSchema) |
|
38 | { |
|
39 | $this->validateSchema = $validateSchema; |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * @param GetResponseEvent $event |
|
44 | */ |
|
45 | public function validateSchema(GetResponseEvent $event) |
|
46 | { |
|
47 | if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) { |
|
48 | $this->validateSchema->assertSchemaIsValid(); |
|
49 | } |
|
50 | } |
|
51 | } |
|
52 |
@@ 9-51 (lines=43) @@ | ||
6 | use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
|
7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
|
8 | ||
9 | class ValidateSchemaListener |
|
10 | { |
|
11 | /** @var ValidateSchemaService */ |
|
12 | protected $validateSchema; |
|
13 | ||
14 | /** @var array */ |
|
15 | protected $excludedEntities = array(); |
|
16 | ||
17 | /** @var array */ |
|
18 | protected $excludedProperties = array(); |
|
19 | ||
20 | /** |
|
21 | * Messages from Doctrine\ORM\Tools\SchemaValidator |
|
22 | * |
|
23 | * @var array |
|
24 | */ |
|
25 | protected $schemaValidatorMessages = array( |
|
26 | 'The field \'%s\' ', |
|
27 | 'The field %s ', |
|
28 | 'The association %s ', |
|
29 | 'Cannot map association \'%s\' ', |
|
30 | 'The mappings %s and ', |
|
31 | 'If association %s ' |
|
32 | ); |
|
33 | ||
34 | /** |
|
35 | * @param ValidateSchemaService $validateSchema |
|
36 | */ |
|
37 | public function __construct(ValidateSchemaService $validateSchema) |
|
38 | { |
|
39 | $this->validateSchema = $validateSchema; |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * @param GetResponseEvent $event |
|
44 | */ |
|
45 | public function validateSchema(GetResponseEvent $event) |
|
46 | { |
|
47 | if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) { |
|
48 | $this->validateSchema->assertSchemaIsValid(); |
|
49 | } |
|
50 | } |
|
51 | } |
|
52 |