Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GenericSchemaLocator.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Framework\Module\Dir\Reader as ModuleDirReader;
11 
16 {
20  private $moduleDirReader;
21 
25  private $moduleName;
26 
30  private $perFileSchema;
31 
35  private $schema;
36 
43  public function __construct(ModuleDirReader $reader, $moduleName, $schema, $perFileSchema = null)
44  {
45  $this->moduleDirReader = $reader;
46  $this->moduleName = $moduleName;
47  $this->schema = $schema;
48  $this->perFileSchema = $perFileSchema;
49  }
50 
56  public function getSchema()
57  {
58  return $this->moduleDirReader->getModuleDir(Dir::MODULE_ETC_DIR, $this->moduleName) . '/' . $this->schema;
59  }
60 
66  public function getPerFileSchema()
67  {
68  if ($this->perFileSchema !== null) {
69  return $this->moduleDirReader->getModuleDir(Dir::MODULE_ETC_DIR, $this->moduleName)
70  . '/' . $this->perFileSchema;
71  }
72  }
73 }
__construct(ModuleDirReader $reader, $moduleName, $schema, $perFileSchema=null)