commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChannelReferenceBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class ChannelReferenceBuilder implements Builder
24{
29 private $id;
30
35 private $obj;
36
43 public function getId()
44 {
45 return $this->id;
46 }
47
55 public function getObj()
56 {
57 return $this->obj instanceof ChannelBuilder ? $this->obj->build() : $this->obj;
58 }
59
64 public function withId(?string $id)
65 {
66 $this->id = $id;
67
68 return $this;
69 }
70
75 public function withObj(?Channel $obj)
76 {
77 $this->obj = $obj;
78
79 return $this;
80 }
81
86 public function withObjBuilder(?ChannelBuilder $obj)
87 {
88 $this->obj = $obj;
89
90 return $this;
91 }
92
93 public function build(): ChannelReference
94 {
95 return new ChannelReferenceModel(
96 $this->id,
97 $this->obj instanceof ChannelBuilder ? $this->obj->build() : $this->obj
98 );
99 }
100
101 public static function of(): ChannelReferenceBuilder
102 {
103 return new self();
104 }
105}