commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductUpdateActionCollection.php
1<?php
2
3declare(strict_types=1);
10
13use stdClass;
14
26{
34 public function add($value)
35 {
36 if (!$value instanceof ProductUpdateAction) {
37 throw new InvalidArgumentException();
38 }
39 $this->store($value);
40
41 return $this;
42 }
43
47 protected function mapper()
48 {
49 return function (?int $index): ?ProductUpdateAction {
50 $data = $this->get($index);
51 if ($data instanceof stdClass) {
53 $data = ProductUpdateActionModel::of($data);
54 $this->set($data, $index);
55 }
56
57 return $data;
58 };
59 }
60}