3require_once
"Services/ADT/classes/class.ilADT.php";
4require_once
"Services/ADT/classes/class.ilADTDefinition.php";
26 if (self::$instance ===
null) {
27 self::$instance =
new self;
40 "Float",
"Integer",
"Location",
"Text",
"Boolean",
41 "MultiText",
"Date",
"DateTime",
"Enum",
"MultiEnum",
"Group",
42 'ExternalLink',
'InternalLink'
68 $class =
"ilADT" .
$a_type . $a_class;
69 $file =
"Services/ADT/classes/Types/" .
$a_type .
"/class." . $class .
".php";
70 if (file_exists($file)) {
76 throw new Exception(
"ilADTFactory unknown type: " .
$a_type .
' -> ' . $file);
101 if (!method_exists($a_def,
"getADTInstance")) {
103 return new $class($a_def);
105 return $a_def->getADTInstance();
124 return new $class($a_adt);
137 return new $class($a_adt);
150 return new $class($a_adt);
166 return new $class($a_adt_def);
167 }
catch (Exception $e) {
173 $a_adt_def->
getType() ==
"MultiEnum") {
175 return new $class($a_adt_def);
181 return new $class($a_adt_def);
182 }
catch (Exception $e) {
186 return new $class($a_adt_def);
199 return new $class($a_adt);
215 require_once
"Services/ADT/classes/ActiveRecord/class.ilADTActiveRecord.php";
224 require_once
"Services/ADT/classes/ActiveRecord/class.ilADTActiveRecordByType.php";
An exception for terminatinating execution or to throw for unit testing.
ADT Active Record by type helper class.
ADT Active Record helper class.
ADT definition base class.
getType()
Get type (from class/instance)
static getInstance()
Get singleton.
getSearchBridgeForDefinitionInstance(ilADTDefinition $a_adt_def, $a_range=true, $a_multi=true)
Get search bridge instance for ADT definition.
getDBBridgeForInstance(ilADT $a_adt)
Get DB bridge instance for ADT.
getValidTypes()
Get all ADT types.
static getActiveRecordByTypeInstance(ilADTGroupDBBridge $a_properties)
Get active record by type instance.
static getActiveRecordInstance(ilADTGroupDBBridge $a_properties)
Get active record instance.
getPresentationBridgeForInstance(ilADT $a_adt)
Get presentation bridge instance for ADT.
getFormBridgeForInstance(ilADT $a_adt)
Get form bridge instance for ADT.
__construct()
Constructor.
initTypeClass($a_type, $a_class=null)
Init type-specific class.
static initActiveRecordByType()
Init active record by type.
getDefinitionInstanceByType($a_type)
Get instance of ADT definition.
getActiveRecordBridgeForInstance(ilADT $a_adt)
Get active record instance for ADT.
isValidType($a_type)
Check if given type is valid.
getInstanceByDefinition(ilADTDefinition $a_def)
Get instance of ADT.
getType()
Get type (from class/instance)