Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TableNameResolver.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 {
20  private $filterPattern = '';
21 
31  public function getNameOfOriginTable(string $tableName): string
32  {
33  $tableIsReplica = preg_match($this->getFilterPattern(), $tableName, $matches);
34 
35  return $tableIsReplica ? $matches['table_name'] : $tableName;
36  }
37 
43  private function getFilterPattern(): string
44  {
45  if (!$this->filterPattern) {
46  $this->filterPattern = '#(?<table_name>\S+)_replica$#i';
47  }
48 
49  return $this->filterPattern;
50  }
51 }
$tableName
Definition: trigger.php:13