Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

BuildSchemaSubscriber.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace EzSystems\PlatformInstallerBundle\Event\Subscriber;
10
11 use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvent;
12 use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvents;
13 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
14
15 class BuildSchemaSubscriber implements EventSubscriberInterface
16 {
18 private $schemaFilePath;
19
23 public function __construct(string $schemaFilePath)
24 {
25 $this->schemaFilePath = $schemaFilePath;
26 }
27
33 public static function getSubscribedEvents(): array
34 {
35 return [
36 SchemaBuilderEvents::BUILD_SCHEMA => ['onBuildSchema', 200],
37 ];
38 }
39
43 public function onBuildSchema(SchemaBuilderEvent $event): void
44 {
45 $event
46 ->getSchemaBuilder()
47 ->importSchemaFromFile($this->schemaFilePath);
48 }
49 }
EzSystems\PlatformInstallerBundle\Event\Subscriber\BuildSchemaSubscriber
Definition: BuildSchemaSubscriber.php:16
EzSystems\PlatformInstallerBundle\Event\Subscriber\BuildSchemaSubscriber\onBuildSchema
onBuildSchema(SchemaBuilderEvent $event)
Definition: BuildSchemaSubscriber.php:43
EzSystems\PlatformInstallerBundle\Event\Subscriber\BuildSchemaSubscriber\$schemaFilePath
$schemaFilePath
Definition: BuildSchemaSubscriber.php:18
EzSystems\PlatformInstallerBundle\Event\Subscriber\BuildSchemaSubscriber\getSubscribedEvents
static getSubscribedEvents()
Returns an array of events this subscriber wants to listen to.
Definition: BuildSchemaSubscriber.php:33
EzSystems\PlatformInstallerBundle\Event\Subscriber\BuildSchemaSubscriber\__construct
__construct(string $schemaFilePath)
Definition: BuildSchemaSubscriber.php:23
EzSystems\PlatformInstallerBundle\Event\Subscriber
Definition: BuildSchemaSubscriber.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.