commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MyBusinessUnitAssociateDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
27  protected $version;
28 
33  protected $customer;
34 
40 
41 
45  public function __construct(
46  ?int $version = null,
47  ?MyCustomerDraft $customer = null,
49  ) {
50  $this->version = $version;
51  $this->customer = $customer;
52  $this->associateRoleAssignments = $associateRoleAssignments;
53  }
54 
62  public function getVersion()
63  {
64  if (is_null($this->version)) {
66  $data = $this->raw(self::FIELD_VERSION);
67  if (is_null($data)) {
68  return null;
69  }
70  $this->version = (int) $data;
71  }
72 
73  return $this->version;
74  }
75 
82  public function getCustomer()
83  {
84  if (is_null($this->customer)) {
86  $data = $this->raw(self::FIELD_CUSTOMER);
87  if (is_null($data)) {
88  return null;
89  }
90 
91  $this->customer = MyCustomerDraftModel::of($data);
92  }
93 
94  return $this->customer;
95  }
96 
103  public function getAssociateRoleAssignments()
104  {
105  if (is_null($this->associateRoleAssignments)) {
107  $data = $this->raw(self::FIELD_ASSOCIATE_ROLE_ASSIGNMENTS);
108  if (is_null($data)) {
109  return null;
110  }
111  $this->associateRoleAssignments = AssociateRoleAssignmentDraftCollection::fromArray($data);
112  }
113 
115  }
116 
117 
121  public function setVersion(?int $version): void
122  {
123  $this->version = $version;
124  }
125 
129  public function setCustomer(?MyCustomerDraft $customer): void
130  {
131  $this->customer = $customer;
132  }
133 
138  {
139  $this->associateRoleAssignments = $associateRoleAssignments;
140  }
141 }
setAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments)
__construct(?int $version=null, ?MyCustomerDraft $customer=null, ?AssociateRoleAssignmentDraftCollection $associateRoleAssignments=null)