Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Strategy.php
Go to the documentation of this file.
1 <?php
7 
8 class Strategy implements StrategyInterface
9 {
15  protected $resource;
16 
22  public function __construct(
24  ) {
25  $this->resource = $resource;
26  }
27 
33  protected $useIdxTable = false;
34 
38  public function getUseIdxTable()
39  {
40  return $this->useIdxTable;
41  }
42 
46  public function setUseIdxTable($value = false)
47  {
48  $this->useIdxTable = (bool) $value;
49  return $this;
50  }
51 
55  public function getTableName($tablePrefix)
56  {
57  return $this->resource->getTableName($this->prepareTableName($tablePrefix));
58  }
59 
67  public function prepareTableName($tablePrefix)
68  {
69  return $this->getUseIdxTable()
70  ? $tablePrefix . self::IDX_SUFFIX
71  : $tablePrefix . self::TMP_SUFFIX;
72  }
73 }
$value
Definition: gender.phtml:16
__construct(\Magento\Framework\App\ResourceConnection $resource)
Definition: Strategy.php:22