Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DescribeTable.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
20  private $dbSchemaReader;
21 
27  private static $ignoredSystemTables = ['cache', 'cache_tag', 'flag', 'session', 'setup_module', 'patch_list'];
28 
34  public function __construct(DbSchemaReader $dbSchemaReader)
35  {
36  $this->dbSchemaReader = $dbSchemaReader;
37  }
38 
45  public function describeShard($shardName)
46  {
47  $data = [];
48  $tables = $this->dbSchemaReader->readTables($shardName);
49 
50  foreach ($tables as $table) {
51  if (in_array($table, self::$ignoredSystemTables)) {
52  continue;
53  }
54 
55  $data[$table] = $this->dbSchemaReader->getCreateTableSql($table, $shardName)['Create Table'];
56  }
57 
58  return $data;
59  }
60 }
__construct(DbSchemaReader $dbSchemaReader)
$table
Definition: trigger.php:14