commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProjectUpdateActionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = '';
27 protected $action;
28
33 private static $discriminatorClasses = [
34 'changeBusinessUnitSearchStatus' => ProjectChangeBusinessUnitSearchStatusActionModel::class,
35 'changeCartsConfiguration' => ProjectChangeCartsConfigurationActionModel::class,
36 'changeCountries' => ProjectChangeCountriesActionModel::class,
37 'changeCountryTaxRateFallbackEnabled' => ProjectChangeCountryTaxRateFallbackEnabledActionModel::class,
38 'changeCurrencies' => ProjectChangeCurrenciesActionModel::class,
39 'changeCustomerSearchStatus' => ProjectChangeCustomerSearchStatusActionModel::class,
40 'changeLanguages' => ProjectChangeLanguagesActionModel::class,
41 'changeMessagesConfiguration' => ProjectChangeMessagesConfigurationActionModel::class,
42 'changeMyBusinessUnitStatusOnCreation' => ProjectChangeBusinessUnitStatusOnCreationActionModel::class,
43 'changeName' => ProjectChangeNameActionModel::class,
44 'changeOrderSearchStatus' => ProjectChangeOrderSearchStatusActionModel::class,
45 'changeProductSearchIndexingEnabled' => ProjectChangeProductSearchIndexingEnabledActionModel::class,
46 'changeShoppingListsConfiguration' => ProjectChangeShoppingListsConfigurationActionModel::class,
47 'setExternalOAuth' => ProjectSetExternalOAuthActionModel::class,
48 'setMyBusinessUnitAssociateRoleOnCreation' => ProjectSetBusinessUnitAssociateRoleOnCreationActionModel::class,
49 'setShippingRateInputType' => ProjectSetShippingRateInputTypeActionModel::class,
50 ];
51
55 public function __construct(
56 ?string $action = null
57 ) {
58 $this->action = $action;
59 }
60
65 public function getAction()
66 {
67 if (is_null($this->action)) {
69 $data = $this->raw(self::FIELD_ACTION);
70 if (is_null($data)) {
71 return null;
72 }
73 $this->action = (string) $data;
74 }
75
76 return $this->action;
77 }
78
79
80
81
82
87 public static function resolveDiscriminatorClass($value): string
88 {
90 if (is_object($value) && isset($value->$fieldName)) {
92 $discriminatorValue = $value->$fieldName;
93 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
94 return self::$discriminatorClasses[$discriminatorValue];
95 }
96 }
97 if (is_array($value) && isset($value[$fieldName])) {
99 $discriminatorValue = $value[$fieldName];
100 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
101 return self::$discriminatorClasses[$discriminatorValue];
102 }
103 }
104
106 $type = ProjectUpdateActionModel::class;
107 return $type;
108 }
109}