commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChannelReferenceModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'channel';
29  protected $typeId;
30 
35  protected $id;
36 
41  protected $obj;
42 
43 
47  public function __construct(
48  ?string $id = null,
49  ?Channel $obj = null,
50  ?string $typeId = null
51  ) {
52  $this->id = $id;
53  $this->obj = $obj;
54  $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE;
55  }
56 
63  public function getTypeId()
64  {
65  if (is_null($this->typeId)) {
67  $data = $this->raw(self::FIELD_TYPE_ID);
68  if (is_null($data)) {
69  return null;
70  }
71  $this->typeId = (string) $data;
72  }
73 
74  return $this->typeId;
75  }
76 
83  public function getId()
84  {
85  if (is_null($this->id)) {
87  $data = $this->raw(self::FIELD_ID);
88  if (is_null($data)) {
89  return null;
90  }
91  $this->id = (string) $data;
92  }
93 
94  return $this->id;
95  }
96 
104  public function getObj()
105  {
106  if (is_null($this->obj)) {
108  $data = $this->raw(self::FIELD_OBJ);
109  if (is_null($data)) {
110  return null;
111  }
112 
113  $this->obj = ChannelModel::of($data);
114  }
115 
116  return $this->obj;
117  }
118 
119 
123  public function setId(?string $id): void
124  {
125  $this->id = $id;
126  }
127 
131  public function setObj(?Channel $obj): void
132  {
133  $this->obj = $obj;
134  }
135 }
__construct(?string $id=null, ?Channel $obj=null, ?string $typeId=null)