Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Composite.php
Go to the documentation of this file.
1 <?php
7 
9 
19 {
25  protected $specifications = [];
26 
34  {
35  foreach ($specifications as $specification) {
36  $this->specifications[] = $factory->create($specification);
37  }
38  }
39 
43  public function isSatisfiedBy($paymentMethod)
44  {
45  foreach ($this->specifications as $specification) {
46  if (!$specification->isSatisfiedBy($paymentMethod)) {
47  return false;
48  }
49  }
50  return true;
51  }
52 }
__construct(Factory $factory, $specifications=[])
Definition: Composite.php:33