ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTermsOfServiceCriterionConfig.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
14 public function __construct($data = [])
15 {
16 if (is_array($data)) {
18 } else {
20
21 if (is_string($data)) {
22 $this->fromJson($data);
23 }
24 }
25 }
26
30 public function toJson() : string
31 {
32 $json = json_encode($this);
33
34 return $json;
35 }
36
40 public function fromJson(string $json) : void
41 {
42 $data = json_decode($json, true);
43
44 $this->exchangeArray($data);
45 }
46
50 public function jsonSerialize()
51 {
52 return $this->getArrayCopy();
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceCriterionConfig.
__construct($data=[])
ilTermsOfServiceCriterionConfig constructor.
Interface ilTermsOfServiceJsonSerializable.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$data
Definition: storeScorm.php:23