commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
TimeToLiveRetentionPolicyModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'ttl';
27 protected $strategy;
28
33 protected $config;
34
35
39 public function __construct(
41 ?string $strategy = null
42 ) {
43 $this->config = $config;
44 $this->strategy = $strategy ?? self::DISCRIMINATOR_VALUE;
45 }
46
53 public function getStrategy()
54 {
55 if (is_null($this->strategy)) {
57 $data = $this->raw(self::FIELD_STRATEGY);
58 if (is_null($data)) {
59 return null;
60 }
61 $this->strategy = (string) $data;
62 }
63
64 return $this->strategy;
65 }
66
73 public function getConfig()
74 {
75 if (is_null($this->config)) {
77 $data = $this->raw(self::FIELD_CONFIG);
78 if (is_null($data)) {
79 return null;
80 }
81
82 $this->config = TimeToLiveConfigModel::of($data);
83 }
84
85 return $this->config;
86 }
87
88
92 public function setConfig(?TimeToLiveConfig $config): void
93 {
94 $this->config = $config;
95 }
96}