commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ApprovalFlowApprovalBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use DateTimeImmutable;
19use stdClass;
20
25{
30 private $approver;
31
36 private $approvedAt;
37
44 public function getApprover()
45 {
46 return $this->approver instanceof AssociateBuilder ? $this->approver->build() : $this->approver;
47 }
48
55 public function getApprovedAt()
56 {
57 return $this->approvedAt;
58 }
59
64 public function withApprover(?Associate $approver)
65 {
66 $this->approver = $approver;
67
68 return $this;
69 }
70
75 public function withApprovedAt(?DateTimeImmutable $approvedAt)
76 {
77 $this->approvedAt = $approvedAt;
78
79 return $this;
80 }
81
86 public function withApproverBuilder(?AssociateBuilder $approver)
87 {
88 $this->approver = $approver;
89
90 return $this;
91 }
92
93 public function build(): ApprovalFlowApproval
94 {
96 $this->approver instanceof AssociateBuilder ? $this->approver->build() : $this->approver,
97 $this->approvedAt
98 );
99 }
100
101 public static function of(): ApprovalFlowApprovalBuilder
102 {
103 return new self();
104 }
105}