26 protected array
$map = array();
38 bool $a_reference =
true
42 $this->db =
$DIC->database();
57 return array_key_exists($a_name, $this->map);
66 return (
int) $this->map[$a_name];
78 return $this->properties[$a_name];
90 $this->properties[$a_name] = $a_value;
104 ?
string $a_raw_data =
null
110 switch ($data_type) {
112 $value = (string) $a_data;
116 $value = (bool) $a_data;
120 $value = (
int) $a_data;
129 $value = unserialize($a_data, [
'allowed_classes' =>
false]);
134 $value = $a_raw_data;
149 $data_type = $this->getPropertyType($a_name);
151 $value = $this->getProperty($a_name);
154 switch ($data_type) {
155 case self::TYPE_DATE:
161 case self::TYPE_ARRAY:
163 $value = serialize($value);
173 return array(
"parameters" => $value,
174 "raw_data" => $raw_data);
184 $set =
$ilDB->query(
"SELECT * FROM il_verification" .
185 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
186 if (
$ilDB->numRows($set)) {
187 while ($row =
$ilDB->fetchAssoc($set)) {
188 $this->importProperty(
198 protected function doCreate(
bool $clone_mode =
false): void
200 $this->saveProperties();
205 $this->saveProperties();
217 $ilDB->manipulate(
"DELETE FROM il_verification" .
218 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
220 foreach ($this->getPropertyMap() as $name => $type) {
221 $property = $this->exportProperty($name);
223 $fields = array(
"id" => array(
"integer", $this->
id),
224 "type" => array(
"text", $name),
225 "parameters" => array(
"text", $property[
"parameters"]),
226 "raw_data" => array(
"text", $property[
"raw_data"]));
228 $ilDB->insert(
"il_verification", $fields);
231 $this->handleQuotaUpdate();
247 $this->handleQuotaUpdate();
249 $ilDB->manipulate(
"DELETE FROM il_verification" .
250 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
254 public static function initStorage(
int $a_id, ?
string $a_subdir =
null): string
259 $path = $storage->getAbsolutePath() .
"/";
262 $path .= $a_subdir .
"/";
264 if (!is_dir(
$path)) {
274 $file = $this->getProperty(
"file");
276 $path = self::initStorage($this->
getId(),
"certificate");
277 return $path . $file;
static getASCIIFilename(string $a_filename)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasProperty(string $a_name)
Check if given property is valid.
getProperty(string $a_name)
Get property value.
static initStorage(int $a_id, ?string $a_subdir=null)
exportProperty(string $a_name)
Export property to database.
saveProperties()
Save current properties to database.
__construct(int $a_id=0, bool $a_reference=true)
Constructor.
getPropertyMap()
Return property map (name => type)
importProperty(string $a_type, $a_data=null, ?string $a_raw_data=null)
Import property from database.
getPropertyType(string $a_name)
Get property data type.
setProperty(string $a_name, $a_value)
Set property value.
doCreate(bool $clone_mode=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc