commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ExternalOAuthModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class ExternalOAuthModel extends JsonObjectModel implements ExternalOAuth
21 {
26  protected $url;
27 
33 
34 
38  public function __construct(
39  ?string $url = null,
40  ?string $authorizationHeader = null
41  ) {
42  $this->url = $url;
43  $this->authorizationHeader = $authorizationHeader;
44  }
45 
52  public function getUrl()
53  {
54  if (is_null($this->url)) {
56  $data = $this->raw(self::FIELD_URL);
57  if (is_null($data)) {
58  return null;
59  }
60  $this->url = (string) $data;
61  }
62 
63  return $this->url;
64  }
65 
72  public function getAuthorizationHeader()
73  {
74  if (is_null($this->authorizationHeader)) {
76  $data = $this->raw(self::FIELD_AUTHORIZATION_HEADER);
77  if (is_null($data)) {
78  return null;
79  }
80  $this->authorizationHeader = (string) $data;
81  }
82 
84  }
85 
86 
90  public function setUrl(?string $url): void
91  {
92  $this->url = $url;
93  }
94 
98  public function setAuthorizationHeader(?string $authorizationHeader): void
99  {
100  $this->authorizationHeader = $authorizationHeader;
101  }
102 }
__construct(?string $url=null, ?string $authorizationHeader=null)