ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
$data
Definition: storeScorm.php:23
__construct($data=[])
ilTermsOfServiceCriterionConfig constructor.
Class ilTermsOfServiceCriterionConfig.
Interface ilTermsOfServiceJsonSerializable.
__construct(Container $dic, ilPlugin $plugin)