ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclFieldProperty.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5
14{
15
27 protected $id;
28
38 protected $field_id;
39
48 protected $name;
49
57 protected $value;
58
59
66 public function __construct($primary_key = 0, $connector = null)
67 {
68 parent::__construct($primary_key, $connector);
69 }
70
75 public static function returnDbTableName()
76 {
77 return "il_dcl_field_prop";
78 }
79
80
84 public function getId()
85 {
86 return $this->id;
87 }
88
89
93 public function setId($id)
94 {
95 $this->id = $id;
96 }
97
98
102 public function getFieldId()
103 {
104 return $this->field_id;
105 }
106
107
111 public function setFieldId($field_id)
112 {
113 $this->field_id = $field_id;
114 }
115
116
120 public function getName()
121 {
122 return $this->name;
123 }
124
125
129 public function setName($name)
130 {
131 $this->name = $name;
132 }
133
134
138 public function getValue()
139 {
140 return $this->value;
141 }
142
143
147 public function setValue($value)
148 {
149 $this->value = $value;
150 }
151
152
156 public function create()
157 {
158 $this->value = $this->serializeData($this->value);
159 parent::create();
160 }
161
162
166 public function update()
167 {
168 $this->value = $this->serializeData($this->value);
170 }
171
172
176 public function afterObjectLoad()
177 {
178 $this->value = $this->deserializeData($this->value);
179 }
180
181
188 public function serializeData($value)
189 {
190 if (is_array($value)) {
191 $value = json_encode($value);
192 }
193 return $value;
194 }
195
196
203 public function deserializeData($value)
204 {
205 $deserialize = json_decode($value, true);
206 if (is_array($deserialize)) {
207 return $deserialize;
208 }
209 return $value;
210 }
211}
Class ActiveRecord.
An exception for terminatinating execution or to throw for unit testing.
Class ilDclFieldProperty.
serializeData($value)
Serialize data before storing to db.
deserializeData($value)
Deserialize data before applying to field.
__construct($primary_key=0, $connector=null)
ilDclFieldProperty constructor.
update($pash, $contents, Config $config)