Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TypeHandler.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
15 
19  private $handlers;
20 
24  public function __construct(array $handlers)
25  {
26  $this->handlers = $handlers;
27  }
28 
32  public function save(Product $product, array $data)
33  {
34  foreach ($this->handlers as $handler) {
35  $handler->save($product, $data);
36  }
37  }
38 
42  public function isCanHandle(array $data)
43  {
44  $result = false;
45  foreach ($this->handlers as $handler) {
46  if ($handler->isCanHandle($data)) {
47  $result = true;
48  break;
49  }
50  }
51  return $result;
52  }
53 }
catch(\Exception $e) $handler
Definition: index.php:30