Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompareQtyTrait.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\FixtureInterface;
10 
14 trait CompareQtyTrait
15 {
23  protected function compare(array $products, array $data)
24  {
25  if (empty($data['items_data'])) {
26  return false;
27  }
28 
29  $count = 0;
30  foreach ($data['items_data'] as $key => $item) {
31  if (!isset($products[$key])) {
32  continue;
33  }
34 
35  if ($products[$key]->getData('qty') !== $item['qty']) {
36  ++$count;
37  }
38  }
39 
40  return $count !== 0;
41  }
42 }
$count
Definition: recent.phtml:13