Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
SchemaConfig Class Reference
Inheritance diagram for SchemaConfig:
SchemaConfigInterface

Public Member Functions

 __construct (DbSchemaBuilder $dbSchemaBuilder, DeclarativeSchemaBuilder $declarativeSchemaBuilder, SchemaFactory $schemaFactory, ReaderComposite $readerComposite)
 
 getDbConfig ()
 
 getDeclarationConfig ()
 

Detailed Description

{}

Definition at line 18 of file SchemaConfig.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( DbSchemaBuilder  $dbSchemaBuilder,
DeclarativeSchemaBuilder  $declarativeSchemaBuilder,
SchemaFactory  $schemaFactory,
ReaderComposite  $readerComposite 
)

Constructor.

Parameters
DbSchemaBuilder$dbSchemaBuilder
DeclarativeSchemaBuilder$declarativeSchemaBuilder
SchemaFactory$schemaFactory
ReaderComposite$readerComposite

Definition at line 48 of file SchemaConfig.php.

53  {
54  $this->dbSchemaBuilder = $dbSchemaBuilder;
55  $this->declarativeSchemaBuilder = $declarativeSchemaBuilder;
56  $this->schemaFactory = $schemaFactory;
57  $this->readerComposite = $readerComposite;
58  }

Member Function Documentation

◆ getDbConfig()

getDbConfig ( )

Parse DB schema

Returns
Schema

Implements SchemaConfigInterface.

Definition at line 63 of file SchemaConfig.php.

64  {
65  $schema = $this->schemaFactory->create();
66  $schema = $this->dbSchemaBuilder->build($schema);
67  return $schema;
68  }

◆ getDeclarationConfig()

getDeclarationConfig ( )

Parse XML schema

Returns
Schema

Implements SchemaConfigInterface.

Definition at line 73 of file SchemaConfig.php.

74  {
75  $schema = $this->schemaFactory->create();
76  $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
77  $this->declarativeSchemaBuilder->addTablesData($data['table']);
78  $schema = $this->declarativeSchemaBuilder->build($schema);
79  return $schema;
80  }

The documentation for this class was generated from the following file: