commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ExtensionTriggerBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class ExtensionTriggerBuilder implements Builder
22 {
27  private $resourceTypeId;
28 
33  private $actions;
34 
39  private $condition;
40 
47  public function getResourceTypeId()
48  {
49  return $this->resourceTypeId;
50  }
51 
58  public function getActions()
59  {
60  return $this->actions;
61  }
62 
69  public function getCondition()
70  {
71  return $this->condition;
72  }
73 
78  public function withResourceTypeId(?string $resourceTypeId)
79  {
80  $this->resourceTypeId = $resourceTypeId;
81 
82  return $this;
83  }
84 
89  public function withActions(?array $actions)
90  {
91  $this->actions = $actions;
92 
93  return $this;
94  }
95 
100  public function withCondition(?string $condition)
101  {
102  $this->condition = $condition;
103 
104  return $this;
105  }
106 
107 
108  public function build(): ExtensionTrigger
109  {
110  return new ExtensionTriggerModel(
111  $this->resourceTypeId,
112  $this->actions,
113  $this->condition
114  );
115  }
116 
117  public static function of(): ExtensionTriggerBuilder
118  {
119  return new self();
120  }
121 }