commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AssociateDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
22 final class AssociateDraftModel extends JsonObjectModel implements AssociateDraft
23 {
29 
34  protected $customer;
35 
36 
40  public function __construct(
43  ) {
44  $this->associateRoleAssignments = $associateRoleAssignments;
45  $this->customer = $customer;
46  }
47 
54  public function getAssociateRoleAssignments()
55  {
56  if (is_null($this->associateRoleAssignments)) {
58  $data = $this->raw(self::FIELD_ASSOCIATE_ROLE_ASSIGNMENTS);
59  if (is_null($data)) {
60  return null;
61  }
62  $this->associateRoleAssignments = AssociateRoleAssignmentDraftCollection::fromArray($data);
63  }
64 
66  }
67 
74  public function getCustomer()
75  {
76  if (is_null($this->customer)) {
78  $data = $this->raw(self::FIELD_CUSTOMER);
79  if (is_null($data)) {
80  return null;
81  }
82 
83  $this->customer = CustomerResourceIdentifierModel::of($data);
84  }
85 
86  return $this->customer;
87  }
88 
89 
94  {
95  $this->associateRoleAssignments = $associateRoleAssignments;
96  }
97 
102  {
103  $this->customer = $customer;
104  }
105 }
__construct(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments=null, ?CustomerResourceIdentifier $customer=null)
setAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments)