This repository was archived by the owner on Oct 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
src/Core/Model/Subscription Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 3030 * @method MessageDelivery setCreatedAt(DateTime $createdAt = null)
3131 * @method DateTimeDecorator getLastModifiedAt()
3232 * @method MessageDelivery setLastModifiedAt(DateTime $lastModifiedAt = null)
33+ * @method PayloadNotIncluded getPayloadNotIncluded()
34+ * @method MessageDelivery setPayloadNotIncluded(PayloadNotIncluded $payloadNotIncluded = null)
3335 */
3436class MessageDelivery extends Delivery
3537{
@@ -51,13 +53,28 @@ public function fieldDefinitions()
5153 static ::TYPE => DateTime::class,
5254 static ::DECORATOR => DateTimeDecorator::class
5355 ],
56+ 'payloadNotIncluded ' => [static ::TYPE => PayloadNotIncluded::class],
5457 ]
5558 );
5659 return $ definition ;
5760 }
5861
62+ /**
63+ * @return Message
64+ */
5965 public function getMessage ()
6066 {
6167 return Message::fromArray ($ this ->rawData );
6268 }
69+
70+ /**
71+ * @return string
72+ */
73+ public function getMessageType ()
74+ {
75+ if (is_null ($ this ->getPayloadNotIncluded ())) {
76+ return $ this ->getMessage ()->getType ();
77+ }
78+ return $ this ->getPayloadNotIncluded ()->getPayloadType ();
79+ }
6380}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function fieldDefinitions()
2121 {
2222 return [
2323 'resourceTypeId ' => [static ::TYPE => 'string ' ],
24- 'types ' => [static ::TYPE => 'array ' ]
24+ 'types ' => [static ::TYPE => 'array ' ],
2525 ];
2626 }
2727}
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ */
4+
5+ namespace Commercetools \Core \Model \Subscription ;
6+
7+ use Commercetools \Core \Model \Common \JsonObject ;
8+
9+ /**
10+ * @package Commercetools\Core\Model\Subscription
11+ *
12+ * @method string getReason()
13+ * @method PayloadNotIncluded setReason(string $reason = null)
14+ * @method string getPayloadType()
15+ * @method PayloadNotIncluded setPayloadType(string $payloadType = null)
16+ */
17+ class PayloadNotIncluded extends JsonObject
18+ {
19+ public function fieldDefinitions ()
20+ {
21+ return [
22+ 'reason ' => [static ::TYPE => 'string ' ],
23+ 'payloadType ' => [static ::TYPE => 'string ' ],
24+ ];
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments