Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SpecificationFactory.php
Go to the documentation of this file.
1 <?php
7 
17 {
23  protected $compositeFactory;
24 
28  protected $mapping;
29 
36  public function __construct(\Magento\Payment\Model\Checks\CompositeFactory $compositeFactory, array $mapping)
37  {
38  $this->compositeFactory = $compositeFactory;
39  $this->mapping = $mapping;
40  }
41 
49  public function create($data)
50  {
51  $specifications = array_intersect_key($this->mapping, array_flip((array)$data));
52  return $this->compositeFactory->create(['list' => $specifications]);
53  }
54 }
__construct(\Magento\Payment\Model\Checks\CompositeFactory $compositeFactory, array $mapping)