ILIAS  release_8 Revision v8.23
class.ilTermsOfServiceCriterionConfig.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
31  public function __construct($data = [])
32  {
33  if (is_array($data)) {
35  } else {
37 
38  if (is_string($data)) {
39  $this->fromJson($data);
40  }
41  }
42  }
43 
44  public function toJson(): string
45  {
46  return json_encode($this, JSON_THROW_ON_ERROR);
47  }
48 
49  public function fromJson(string $json): void
50  {
51  $data = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
52 
53  $this->exchangeArray($data);
54  }
55 
56  public function jsonSerialize(): array
57  {
58  return $this->getArrayCopy();
59  }
60 }
__construct($data=[])
ilTermsOfServiceCriterionConfig constructor.
Class ilTermsOfServiceCriterionConfig.
Interface ilTermsOfServiceJsonSerializable.
__construct(Container $dic, ilPlugin $plugin)