-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathRRSetProtection.php
More file actions
49 lines (42 loc) · 958 Bytes
/
RRSetProtection.php
File metadata and controls
49 lines (42 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Created by PhpStorm.
* User: lukaskammerling
* Date: 01.04.18
* Time: 19:02.
*/
namespace LKDev\HetznerCloud\Models\Zones;
// This is a read only model, that does not have any logic. Just a stupid dataholder.
use LKDev\HetznerCloud\Models\Model;
class RRSetProtection extends Model
{
/**
* @var bool
*/
public $change;
/**
* Protection constructor.
*
* @param bool $change
*/
public function __construct(bool $delete)
{
$this->change = $delete;
// Force getting the default http client
parent::__construct(null);
}
/**
* @param array $input
* @return ?RRSetProtection
*/
public static function parse($input)
{
if ($input == null) {
return null;
}
if (! is_array($input)) {
$input = get_object_vars($input);
}
return new self($input['change'] ?? false);
}
}