Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
CalculationData.php
Go to the documentation of this file.
1 <?php
7 
10 
16 {
18  const CALCULATION_DATA_ALIAS = "cd";
19 
24  public function apply(AbstractDb $collection)
25  {
26  $isNotApplied = !array_key_exists(
27  self::CALCULATION_DATA_ALIAS,
28  $collection->getSelect()->getPart(\Magento\Framework\Db\Select::FROM)
29  );
30  if ($isNotApplied) {
31  $collection->joinCalculationData(self::CALCULATION_DATA_ALIAS);
32  return true;
33  }
34 
35  return false;
36  }
37 }