ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilAdvancedMDClaimingPlugin Class Reference

Abstract parent class for all advanced md claiming plugin classes. More...

+ Inheritance diagram for ilAdvancedMDClaimingPlugin:
+ Collaboration diagram for ilAdvancedMDClaimingPlugin:

Public Member Functions

 getComponentType ()
 Get Component Type. More...
 
 getComponentName ()
 Get Component Name. More...
 
 getSlot ()
 Get Slot Name. More...
 
 getSlotId ()
 Get Slot ID. More...
 
 checkPermission ($a_user_id, $a_context_type, $a_context_id, $a_action_id, $a_action_sub_id)
 Check permission. More...
 
- Public Member Functions inherited from ilPlugin
 __construct ()
 Constructor. More...
 
 getComponentType ()
 Get Component Type. More...
 
 getComponentName ()
 Get Component Name. More...
 
 getSlot ()
 Get Slot Name. More...
 
 getSlotId ()
 Get Slot ID. More...
 
 getPluginName ()
 Get Plugin Name. More...
 
 getId ()
 Get Id. More...
 
 getLastUpdateVersion ()
 Get Version of last update. More...
 
 getVersion ()
 Get Current Version (from plugin.php file). More...
 
 getIliasMinVersion ()
 Get Required ILIAS min. More...
 
 getIliasMaxVersion ()
 Get Required ILIAS max. More...
 
 getActive ()
 Get Active. More...
 
 setDBVersion ($a_dbversion)
 Set DB Version. More...
 
 getDBVersion ()
 Get DB Version. More...
 
 writeDBVersion ($a_dbversion)
 Write DB version to database. More...
 
 getDirectory ()
 Get Plugin Directory. More...
 
 includeClass ($a_class_file_name)
 Include (once) a class file. More...
 
 getPrefix ()
 Get plugin prefix, used for lang vars. More...
 
 getTablePrefix ()
 Get db table plugin prefix. More...
 
 updateLanguages ($a_lang_keys=null)
 
 updateDatabase ()
 Update database. More...
 
 loadLanguageModule ()
 Load language module for plugin. More...
 
 txt ($a_var)
 Get Language Variable (prefix will be prepended automatically) More...
 
 getTemplate ($a_template, $a_par1=true, $a_par2=true)
 Get template from plugin. More...
 
 getImagePath ($a_img)
 Get image path. More...
 
 getStyleSheetLocation ($a_css_file)
 Get css file location. More...
 
 addBlockFile ($a_tpl, $a_var, $a_block, $a_tplname)
 Add template content to placeholder variable. More...
 
 isActive ()
 Check whether plugin is active. More...
 
 needsUpdate ()
 Check whether update is needed. More...
 
 activate ()
 Activate. More...
 
 deactivate ()
 Deactivate. More...
 
 update ()
 Update plugin. More...
 
 lookupNameForId ($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
 Lookup name for id. More...
 
 lookupIdForName ($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
 Lookup id for name. More...
 

Static Public Member Functions

static hasDBRecord ($a_record_id)
 Check if record has db entry. More...
 
static createDBRecord ($a_title, $a_description, $a_active, array $a_obj_types)
 Create record db entry. More...
 
static updateDBRecord ($a_record_id, $a_title, $a_description, $a_active, array $a_obj_types)
 Update record db entry. More...
 
static deleteDBRecord ($a_record_id)
 Delete record db entry. More...
 
static hasDBField ($a_field_id)
 Check if field has db entry. More...
 
static createDBField ($a_record_id, $a_type, $a_title, $a_description=null, $a_searchable=false, array $a_definition=null)
 Create field db entry. More...
 
static updateDBField ($a_field_id, $a_title, $a_description=null, $a_searchable=false, array $a_definition=null)
 Update field db entry. More...
 
static deleteDBField ($a_field_id)
 Delete field db entry. More...
 
static setDBSubstitution ($a_obj_type, $a_show_description, $a_show_field_names)
 Set substitution DB entry (for object type) More...
 
static hasDBFieldSubstitution ($a_obj_type, $a_field_id)
 Is substitution active for field in object type. More...
 
static setDBFieldSubstitution ($a_obj_type, $a_field_id, $a_bold=false, $a_newline=false)
 Update field substitution entry in DB. More...
 
static removeDBFieldSubstitution ($a_obj_type, $a_field_id)
 Remove field substitution entry in DB. More...
 
- Static Public Member Functions inherited from ilPlugin
static _getDirectory ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get plugin directory. More...
 
static getAvailableLangFiles ($a_lang_directory)
 Get array of all language files in the plugin. More...
 
static hasConfigureClass ($a_slot_dir, $a_name)
 Has the plugin a configure class? More...
 
static getConfigureClassName ($a_name)
 Get plugin configure class name. More...
 
static getDBUpdateScriptName ($a_ctype, $a_cname, $a_slot_name, $a_pname)
 Get DB update script filename (full path) More...
 
static lookupTxt ($a_mod_prefix, $a_pl_id, $a_lang_var)
 Lookup language text. More...
 
static _getImagePath ($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img)
 Get image path. More...
 
static createPluginRecord ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Create plugin record, if not existing. More...
 
static getPluginRecord ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get record from il_plugin table. More...
 
static getPluginObject ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get plugin object. More...
 
static lookupStoredData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Lookup information data in il_plugin. More...
 
static getActivePluginsForSlot ($a_ctype, $a_cname, $a_slot_id)
 Get all active plugins for a slot. More...
 

Protected Member Functions

 slotInit ()
 Object initialization done by slot. More...
 
- Protected Member Functions inherited from ilPlugin
 setSlotObject ($a_slot)
 Set Plugin Slot. More...
 
 getSlotObject ()
 Get Plugin Slot. More...
 
 getClassesDirectory ()
 Get Plugin's classes Directory. More...
 
 getLanguageDirectory ()
 Get Plugin's language Directory. More...
 
 slotInit ()
 Object initialization done by slot. More...
 
 init ()
 Object initialization. More...
 
 beforeActivation ()
 Before activation processing. More...
 
 afterActivation ()
 After activation processing. More...
 
 afterDeactivation ()
 After deactivation processing. More...
 
 beforeUpdate ()
 Before update processing. More...
 
 afterUpdate ()
 After update processing. More...
 

Static Protected Member Functions

static isValidObjType ($a_obj_type, $a_is_substitution=false)
 Validate object type. More...
 
static saveRecordObjTypes ($a_record_id, array $a_obj_types)
 Save object type assignments for record. More...
 
static getDBFieldLastPosition ($a_record_id)
 Get last position of record. More...
 
static getDBSubstitution ($a_obj_type, $a_include_field_data=false)
 Get substitution DB data for object type. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilPlugin
 $lang_initialised = false
 

Detailed Description

Abstract parent class for all advanced md claiming plugin classes.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilAdvancedMDClaimingPlugin.php.

Member Function Documentation

◆ checkPermission()

ilAdvancedMDClaimingPlugin::checkPermission (   $a_user_id,
  $a_context_type,
  $a_context_id,
  $a_action_id,
  $a_action_sub_id 
)
abstract

Check permission.

Parameters
int$a_user_id
int$a_context_type
int$a_context_id
int$a_action_id
int$a_action_sub_id
Returns
bool

◆ createDBField()

static ilAdvancedMDClaimingPlugin::createDBField (   $a_record_id,
  $a_type,
  $a_title,
  $a_description = null,
  $a_searchable = false,
array  $a_definition = null 
)
static

Create field db entry.

Parameters
int$a_record_id
int$a_type
string$a_title
string$a_description
bool$a_searchable
array$a_definition
Returns
int field id

Definition at line 273 of file class.ilAdvancedMDClaimingPlugin.php.

274 {
275 global $ilDB;
276
277 if(!self::hasDBRecord($a_record_id))
278 {
279 return;
280 }
281
282 $field_id = $ilDB->nextId("adv_mdf_definition");
283
284 // validating type
285 $a_type = (int)$a_type;
286 if($a_type < 1 || $a_type > 7)
287 {
288 return;
289 }
290
291 $pos = self::getDBFieldLastPosition($a_record_id)+1;
292
293 $fields = array(
294 "record_id" => array("integer", $a_record_id),
295 "field_id" => array("integer", $field_id),
296 "import_id" => array("text", "il_".IL_INST_ID."_adv_md_field_".$field_id),
297 "field_type" => array("integer", $a_type),
298 "position" => array("integer", $pos),
299 "title" => array("text", trim($a_title)),
300 "description" => array("text", trim($a_description)),
301 "searchable" => array("integer", (int)$a_searchable)
302 );
303 if($a_definition)
304 {
305 $fields["field_values"] = array("text", serialize($a_definition));
306 }
307 $ilDB->insert("adv_mdf_definition", $fields);
308
309 return $field_id;
310 }
static getDBFieldLastPosition($a_record_id)
Get last position of record.
global $ilDB

References $ilDB, and getDBFieldLastPosition().

+ Here is the call graph for this function:

◆ createDBRecord()

static ilAdvancedMDClaimingPlugin::createDBRecord (   $a_title,
  $a_description,
  $a_active,
array  $a_obj_types 
)
static

Create record db entry.

Parameters
string$a_title
string$a_description
bool$a_active
array$a_obj_types
Returns
int record id

Definition at line 92 of file class.ilAdvancedMDClaimingPlugin.php.

93 {
94 global $ilDB;
95
96 $record_id = $ilDB->nextId("adv_md_record");
97
98 $fields = array(
99 "record_id" => array("integer", $record_id),
100 "import_id" => array("text", 'il_'.IL_INST_ID.'_adv_md_record_'.$record_id),
101 "title" => array("text", trim($a_title)),
102 "description" => array("text", trim($a_description)),
103 "active" => array("integer", (int)$a_active)
104 );
105 $ilDB->insert("adv_md_record", $fields);
106
107 self::saveRecordObjTypes($record_id, $a_obj_types);
108
109 return $record_id;
110 }
static saveRecordObjTypes($a_record_id, array $a_obj_types)
Save object type assignments for record.

References $ilDB, and saveRecordObjTypes().

+ Here is the call graph for this function:

◆ deleteDBField()

static ilAdvancedMDClaimingPlugin::deleteDBField (   $a_field_id)
static

Delete field db entry.

Parameters
int$a_field_id
Returns
bool

Definition at line 352 of file class.ilAdvancedMDClaimingPlugin.php.

353 {
354 global $ilDB;
355
356 if(self::hasDBField($a_field_id))
357 {
358 $ilDB->manipulate("DELETE FROM adv_mdf_definition".
359 " WHERE field_id = ".$ilDB->quote($a_field_id, "integer"));
360 return true;
361 }
362
363 return false;
364 }

References $ilDB.

◆ deleteDBRecord()

static ilAdvancedMDClaimingPlugin::deleteDBRecord (   $a_record_id)
static

Delete record db entry.

Parameters
int$a_record_id
Returns
bool

Definition at line 208 of file class.ilAdvancedMDClaimingPlugin.php.

209 {
210 global $ilDB;
211
212 if(self::hasDBRecord($a_record_id))
213 {
214 $ilDB->manipulate("DELETE FROM adv_md_record".
215 " WHERE record_id = ".$ilDB->quote($a_record_id, "integer"));
216 return true;
217 }
218
219 return false;
220 }

References $ilDB.

◆ getComponentName()

ilAdvancedMDClaimingPlugin::getComponentName ( )
final

Get Component Name.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Component Name

Reimplemented from ilPlugin.

Definition at line 26 of file class.ilAdvancedMDClaimingPlugin.php.

27 {
28 return "AdvancedMetaData";
29 }

◆ getComponentType()

ilAdvancedMDClaimingPlugin::getComponentType ( )
final

Get Component Type.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Component Type

Reimplemented from ilPlugin.

Definition at line 21 of file class.ilAdvancedMDClaimingPlugin.php.

22 {
23 return IL_COMP_SERVICE;
24 }
const IL_COMP_SERVICE

References IL_COMP_SERVICE.

◆ getDBFieldLastPosition()

static ilAdvancedMDClaimingPlugin::getDBFieldLastPosition (   $a_record_id)
staticprotected

Get last position of record.

See also
ilAdvancedMDFieldDefinition::getLastPosition()
Parameters
int$a_record_id
Returns
int

Definition at line 245 of file class.ilAdvancedMDClaimingPlugin.php.

246 {
247 global $ilDB;
248
249 $sql = "SELECT max(position) pos".
250 " FROM adv_mdf_definition".
251 " WHERE record_id = ".$ilDB->quote($a_record_id, "integer");
252 $set = $ilDB->query($sql);
253 if($ilDB->numRows($set))
254 {
255 $pos = $ilDB->fetchAssoc($set);
256 return (int)$pos["pos"];
257 }
258
259 return 0;
260 }

References $ilDB.

Referenced by createDBField().

+ Here is the caller graph for this function:

◆ getDBSubstitution()

static ilAdvancedMDClaimingPlugin::getDBSubstitution (   $a_obj_type,
  $a_include_field_data = false 
)
staticprotected

Get substitution DB data for object type.

Parameters
string$a_obj_type
bool$a_include_field_data
Returns
array

Definition at line 373 of file class.ilAdvancedMDClaimingPlugin.php.

374 {
375 global $ilDB;
376
377 $set = $ilDB->query("SELECT * FROM adv_md_substitutions".
378 " WHERE obj_type = ".$ilDB->quote($a_obj_type, "text"));
379 if($ilDB->numRows($set))
380 {
381 $res = $ilDB->fetchAssoc($set);
382 $res["hide_description"] = array("integer", (bool)$res["hide_description"]);
383 $res["hide_field_names"] = array("integer", (bool)$res["hide_field_names"]);
384
385 if($a_include_field_data)
386 {
387 $res["substitution"] = array("text", (array)unserialize($res["substitution"]));
388 }
389 else
390 {
391 unset($res["substitution"]);
392 }
393 unset($res["obj_type"]);
394
395 return $res;
396 }
397 }

References $ilDB, and $res.

Referenced by hasDBFieldSubstitution(), removeDBFieldSubstitution(), setDBFieldSubstitution(), and setDBSubstitution().

+ Here is the caller graph for this function:

◆ getSlot()

ilAdvancedMDClaimingPlugin::getSlot ( )
final

Get Slot Name.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Slot Name

Reimplemented from ilPlugin.

Definition at line 31 of file class.ilAdvancedMDClaimingPlugin.php.

32 {
33 return "AdvancedMDClaiming";
34 }

◆ getSlotId()

ilAdvancedMDClaimingPlugin::getSlotId ( )
final

Get Slot ID.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Slot Id

Reimplemented from ilPlugin.

Definition at line 36 of file class.ilAdvancedMDClaimingPlugin.php.

37 {
38 return "amdc";
39 }

◆ hasDBField()

static ilAdvancedMDClaimingPlugin::hasDBField (   $a_field_id)
static

Check if field has db entry.

Parameters
int$a_field_id
Returns
bool

Definition at line 228 of file class.ilAdvancedMDClaimingPlugin.php.

229 {
230 global $ilDB;
231
232 $set = $ilDB->query("SELECT field_id FROM adv_mdf_definition".
233 " WHERE field_id = ".$ilDB->quote($a_field_id, "integer"));
234 return (bool)$ilDB->numRows($set);
235 }

References $ilDB.

◆ hasDBFieldSubstitution()

static ilAdvancedMDClaimingPlugin::hasDBFieldSubstitution (   $a_obj_type,
  $a_field_id 
)
static

Is substitution active for field in object type.

Parameters
string$a_obj_type
int$a_field_id
Returns
bool

Definition at line 447 of file class.ilAdvancedMDClaimingPlugin.php.

448 {
449 if(self::isValidObjType($a_obj_type, true))
450 {
451 $fields = self::getDBSubstitution($a_obj_type, true);
452 $fields = $fields["substitution"][1];
453 foreach($fields as $field)
454 {
455 if($field["field_id"] == $a_field_id)
456 {
457 return true;
458 }
459 }
460 return false;
461 }
462 }
static getDBSubstitution($a_obj_type, $a_include_field_data=false)
Get substitution DB data for object type.

References getDBSubstitution().

+ Here is the call graph for this function:

◆ hasDBRecord()

static ilAdvancedMDClaimingPlugin::hasDBRecord (   $a_record_id)
static

Check if record has db entry.

Parameters
int$a_record_id
Returns
bool

Definition at line 74 of file class.ilAdvancedMDClaimingPlugin.php.

75 {
76 global $ilDB;
77
78 $set = $ilDB->query("SELECT record_id FROM adv_md_record".
79 " WHERE record_id = ".$ilDB->quote($a_record_id, "integer"));
80 return (bool)$ilDB->numRows($set);
81 }

References $ilDB.

◆ isValidObjType()

static ilAdvancedMDClaimingPlugin::isValidObjType (   $a_obj_type,
  $a_is_substitution = false 
)
staticprotected

Validate object type.

Parameters
string$a_obj_type
bool$a_is_substitution
Returns
bool

Definition at line 119 of file class.ilAdvancedMDClaimingPlugin.php.

120 {
121 // ecs, glossary not supported yet
122 $valid = array("crs", "cat");
123
124 if(!$a_is_substitution)
125 {
126 $valid[] = "orgu";
127 }
128
129 return in_array($a_obj_type, $valid);
130 }
$valid

References $valid.

◆ removeDBFieldSubstitution()

static ilAdvancedMDClaimingPlugin::removeDBFieldSubstitution (   $a_obj_type,
  $a_field_id 
)
static

Remove field substitution entry in DB.

Parameters
string$a_obj_type
int$a_field_id
Returns
bool

Definition at line 524 of file class.ilAdvancedMDClaimingPlugin.php.

525 {
526 global $ilDB;
527
528 if(self::isValidObjType($a_obj_type, true))
529 {
530 $fields = self::getDBSubstitution($a_obj_type, true);
531 if(!$fields)
532 {
533 return true;
534 }
535 else
536 {
537 $fields = $fields["substitution"][1];
538 }
539
540 $found = false;
541 foreach($fields as $idx => $field)
542 {
543 if($field["field_id"] == $a_field_id)
544 {
545 unset($fields[$idx]);
546 $found = true;
547 break;
548 }
549 }
550 if($found)
551 {
552 $fields = array("substitution"=>array("text", serialize($fields)));
553 $ilDB->update("adv_md_substitutions", $fields,
554 array("obj_type" => array("text", $a_obj_type)));
555 }
556 return true;
557 }
558 return false;
559 }

References $ilDB, and getDBSubstitution().

+ Here is the call graph for this function:

◆ saveRecordObjTypes()

static ilAdvancedMDClaimingPlugin::saveRecordObjTypes (   $a_record_id,
array  $a_obj_types 
)
staticprotected

Save object type assignments for record.

Parameters
int$a_record_id
array$a_obj_types

Definition at line 138 of file class.ilAdvancedMDClaimingPlugin.php.

139 {
140 global $ilDB;
141
142 foreach($a_obj_types as $type)
143 {
144 if(!is_array($type))
145 {
146 $type = strtolower(trim($type));
147 $subtype = "-";
148 }
149 else
150 {
151 $type = strtolower(trim($type[0]));
152 $subtype = strtolower(trim($type[1]));
153 }
154
155 if(self::isValidObjType($type))
156 {
157 $fields = array(
158 "record_id" => array("integer", $a_record_id),
159 "obj_type" => array("text", $type),
160 "sub_type" => array("text", $subtype)
161 );
162 $ilDB->insert("adv_md_record_objs", $fields);
163 }
164 }
165 }

References $ilDB.

Referenced by createDBRecord(), and updateDBRecord().

+ Here is the caller graph for this function:

◆ setDBFieldSubstitution()

static ilAdvancedMDClaimingPlugin::setDBFieldSubstitution (   $a_obj_type,
  $a_field_id,
  $a_bold = false,
  $a_newline = false 
)
static

Update field substitution entry in DB.

Parameters
string$a_obj_type
int$a_field_id
bool$a_bold
bool$a_newline
Returns
bool

Definition at line 473 of file class.ilAdvancedMDClaimingPlugin.php.

474 {
475 global $ilDB;
476
477 if(self::isValidObjType($a_obj_type, true))
478 {
479 $fields = self::getDBSubstitution($a_obj_type, true);
480 if(!$fields)
481 {
482 self::setDBSubstitution($a_obj_type, true, true);
483 $fields = array();
484 }
485 else
486 {
487 $fields = $fields["substitution"][1];
488 }
489
490 $found = false;
491 foreach($fields as $idx => $field)
492 {
493 if($field["field_id"] == $a_field_id)
494 {
495 $fields[$idx]["bold"] = (bool)$a_bold;
496 $fields[$idx]["newline"] = (bool)$a_newline;
497 $found = true;
498 break;
499 }
500 }
501 if(!$found)
502 {
503 $fields[] = array(
504 "field_id" => $a_field_id
505 ,"bold" => (bool)$a_bold
506 ,"newline" => (bool)$a_newline
507 );
508 }
509
510 $fields = array("substitution"=>array("text", serialize($fields)));
511 $ilDB->update("adv_md_substitutions", $fields,
512 array("obj_type" => array("text", $a_obj_type)));
513 }
514 return false;
515 }
static setDBSubstitution($a_obj_type, $a_show_description, $a_show_field_names)
Set substitution DB entry (for object type)

References $ilDB, getDBSubstitution(), and setDBSubstitution().

+ Here is the call graph for this function:

◆ setDBSubstitution()

static ilAdvancedMDClaimingPlugin::setDBSubstitution (   $a_obj_type,
  $a_show_description,
  $a_show_field_names 
)
static

Set substitution DB entry (for object type)

Parameters
string$a_obj_type
bool$a_show_description
bool$a_show_field_names
Returns
bool

Definition at line 407 of file class.ilAdvancedMDClaimingPlugin.php.

408 {
409 global $ilDB;
410
411 if(self::isValidObjType($a_obj_type, true))
412 {
413 $fields = self::getDBSubstitution($a_obj_type);
414
415 $create = false;
416 if(!$fields)
417 {
418 $create = true;
419 $fields = array("obj_type" => array("text", $a_obj_type));
420 }
421
422 $fields["hide_description"] = array("integer", !(bool)$a_show_description);
423 $fields["hide_field_names"] = array("integer", !(bool)$a_show_field_names);
424
425 if($create)
426 {
427 $ilDB->insert("adv_md_substitutions", $fields);
428 }
429 else
430 {
431 $ilDB->update("adv_md_substitutions", $fields,
432 array("obj_type" => array("text", $a_obj_type)));
433 }
434
435 return true;
436 }
437 return false;
438 }

References $ilDB, and getDBSubstitution().

Referenced by setDBFieldSubstitution().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slotInit()

ilAdvancedMDClaimingPlugin::slotInit ( )
finalprotected

Object initialization done by slot.

Must be overwritten in plugin class of plugin slot.

(and should be made protected final)

Reimplemented from ilPlugin.

Definition at line 41 of file class.ilAdvancedMDClaimingPlugin.php.

42 {
43 require_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDPermissionHelper.php";
44 }

◆ updateDBField()

static ilAdvancedMDClaimingPlugin::updateDBField (   $a_field_id,
  $a_title,
  $a_description = null,
  $a_searchable = false,
array  $a_definition = null 
)
static

Update field db entry.

Parameters
int$a_field_id
string$a_title
string$a_description
bool$a_searchable
array$a_definition
Returns
bool

Definition at line 322 of file class.ilAdvancedMDClaimingPlugin.php.

323 {
324 global $ilDB;
325
326 if(self::hasDBField($a_field_id))
327 {
328 $fields = array(
329 "field_id" => array("integer", $a_field_id),
330 "title" => array("text", trim($a_title)),
331 "description" => array("text", trim($a_description)),
332 "searchable" => array("integer", (int)$a_searchable)
333 );
334 if($a_definition)
335 {
336 $fields["field_values"] = array("text", serialize($a_definition));
337 }
338 $ilDB->update("adv_mdf_definition", $fields,
339 array("field_id" => array("integer", $a_field_id)));
340 return true;
341 }
342
343 return false;
344 }

References $ilDB.

◆ updateDBRecord()

static ilAdvancedMDClaimingPlugin::updateDBRecord (   $a_record_id,
  $a_title,
  $a_description,
  $a_active,
array  $a_obj_types 
)
static

Update record db entry.

Parameters
int$a_record_id
string$a_title
string$a_description
bool$a_active
array$a_obj_types
Returns
bool

Definition at line 177 of file class.ilAdvancedMDClaimingPlugin.php.

178 {
179 global $ilDB;
180
181 if(self::hasDBRecord($a_record_id))
182 {
183 $fields = array(
184 "title" => array("text", trim($a_title)),
185 "description" => array("text", trim($a_description)),
186 "active" => array("integer", (int)$a_active)
187 );
188 $ilDB->update("adv_md_record", $fields,
189 array("record_id" => array("integer", $a_record_id)));
190
191 $ilDB->manipulate("DELETE FROM adv_md_record_objs".
192 " WHERE record_id = ".$ilDB->quote($a_record_id, "integer"));
193
194 self::saveRecordObjTypes($a_record_id, $a_obj_types);
195
196 return true;
197 }
198
199 return false;
200 }

References $ilDB, and saveRecordObjTypes().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: