commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ReviewSetTargetActionModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
26 public const DISCRIMINATOR_VALUE = 'setTarget';
31 protected $action;
32
37 protected $target;
38
39
43 public function __construct(
44 ?JsonObject $target = null,
45 ?string $action = null
46 ) {
47 $this->target = $target;
48 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
49 }
50
55 public function getAction()
56 {
57 if (is_null($this->action)) {
59 $data = $this->raw(self::FIELD_ACTION);
60 if (is_null($data)) {
61 return null;
62 }
63 $this->action = (string) $data;
64 }
65
66 return $this->action;
67 }
68
75 public function getTarget()
76 {
77 if (is_null($this->target)) {
79 $data = $this->raw(self::FIELD_TARGET);
80 if (is_null($data)) {
81 return null;
82 }
83 $this->target = $data;
84 }
85
86 return $this->target;
87 }
88
95 {
97 $data = $this->raw(self::FIELD_TARGET);
98 if (is_null($data)) {
99 return null;
100 }
101
102 return ProductResourceIdentifierModel::of($data);
103 }
104
111 {
113 $data = $this->raw(self::FIELD_TARGET);
114 if (is_null($data)) {
115 return null;
116 }
117
118 return ChannelResourceIdentifierModel::of($data);
119 }
120
124 public function setTarget(?JsonObject $target): void
125 {
126 $this->target = $target;
127 }
128}
__construct(?JsonObject $target=null, ?string $action=null)