ILIAS  release_7 Revision v7.30-3-g800a261c036
class.assAnswerMatchingTerm.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13 protected $arrData;
14
22 public function __construct($text = "", $picture = "", $identifier = "")
23 {
24 if (strlen($identifier) == 0) {
25 mt_srand((double) microtime() * 1000000);
26 $identifier = mt_rand(1, 100000);
27 }
28 $this->arrData = array(
29 'text' => $text,
30 'picture' => $picture,
31 'identifier' => $identifier
32 );
33 }
34
38 public function __get($value)
39 {
40 switch ($value) {
41 case "text":
42 case "picture":
43 if (strlen($this->arrData[$value])) {
44 return $this->arrData[$value];
45 } else {
46 return null;
47 }
48 break;
49 case "identifier":
50 return $this->arrData[$value];
51 break;
52 default:
53 return null;
54 break;
55 }
56 }
57
61 public function __set($key, $value)
62 {
63 switch ($key) {
64 case "text":
65 case "picture":
66 case "identifier":
67 $this->arrData[$key] = $value;
68 break;
69 default:
70 break;
71 }
72 }
73}
An exception for terminatinating execution or to throw for unit testing.
Class for matching question terms.
__construct($text="", $picture="", $identifier="")
assAnswerMatchingTerm constructor
__set($key, $value)
Object setter.