ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
ILIAS\COPage\PC\PCDefinition Class Reference
+ Inheritance diagram for ILIAS\COPage\PC\PCDefinition:
+ Collaboration diagram for ILIAS\COPage\PC\PCDefinition:

Public Member Functions

 __construct ()
 
 getRecords ()
 
 getPCDefinitions ()
 
 getPCDefinitionByType (string $a_pc_type)
 Get PC definition by type. More...
 
 getPCDefinitionByName (string $a_pc_name)
 Get PC definition by name. More...
 
 getPCDefinitionByGUIClassName (string $a_gui_class_name)
 Get PC definition by name. More...
 
 isPCGUIClassName (string $a_class_name, bool $a_lower_case=false)
 
 getPCEditorInstanceByName (string $a_name)
 Get instance. More...
 
 getPCModelProviderByName (string $a_name)
 

Protected Member Functions

 init ()
 

Protected Attributes

ilDBInterface $db
 
array $pc_def = []
 
array $pc_def_by_name = []
 
array $pc_gui_classes = array()
 
array $pc_gui_classes_lc = array()
 
array $pc_def_by_gui_class_cl = array()
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\PC\PCDefinition::__construct ( )

Definition at line 35 of file class.PCDefinition.php.

References $DIC.

36  {
37  global $DIC;
38 
39  $this->db = $DIC->database();
40  }
global $DIC
Definition: shib_login.php:26

Member Function Documentation

◆ getPCDefinitionByGUIClassName()

ILIAS\COPage\PC\PCDefinition::getPCDefinitionByGUIClassName ( string  $a_gui_class_name)

Get PC definition by name.

Definition at line 93 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\init().

95  : array {
96  $this->init();
97  $a_gui_class_name = strtolower($a_gui_class_name);
98  return $this->pc_def_by_gui_class_cl[$a_gui_class_name];
99  }
+ Here is the call graph for this function:

◆ getPCDefinitionByName()

ILIAS\COPage\PC\PCDefinition::getPCDefinitionByName ( string  $a_pc_name)

Get PC definition by name.

Definition at line 83 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\init().

Referenced by ILIAS\COPage\PC\PCDefinition\getPCEditorInstanceByName(), and ILIAS\COPage\PC\PCDefinition\getPCModelProviderByName().

85  : array {
86  $this->init();
87  return $this->pc_def_by_name[$a_pc_name];
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPCDefinitionByType()

ILIAS\COPage\PC\PCDefinition::getPCDefinitionByType ( string  $a_pc_type)

Get PC definition by type.

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

References ILIAS\COPage\PC\PCDefinition\init(), and null.

74  : ?array
75  {
76  $this->init();
77  return ($this->pc_def[$a_pc_type] ?? null);
78  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getPCDefinitions()

ILIAS\COPage\PC\PCDefinition::getPCDefinitions ( )

Definition at line 65 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\$pc_def, and ILIAS\COPage\PC\PCDefinition\init().

65  : array
66  {
67  $this->init();
68  return $this->pc_def;
69  }
+ Here is the call graph for this function:

◆ getPCEditorInstanceByName()

ILIAS\COPage\PC\PCDefinition::getPCEditorInstanceByName ( string  $a_name)

Get instance.

Definition at line 116 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\getPCDefinitionByName(), ILIAS\COPage\PC\PCDefinition\init(), and null.

119  $this->init();
120  $pc_def = $this->getPCDefinitionByName($a_name);
121  $pc_class = "ilPC" . $pc_def["name"] . "EditorGUI";
122  if (class_exists($pc_class)) {
123  return new $pc_class();
124  }
125  return null;
126  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPCDefinitionByName(string $a_pc_name)
Get PC definition by name.
+ Here is the call graph for this function:

◆ getPCModelProviderByName()

ILIAS\COPage\PC\PCDefinition::getPCModelProviderByName ( string  $a_name)

Definition at line 128 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\getPCDefinitionByName(), ILIAS\COPage\PC\PCDefinition\init(), and null.

131  $this->init();
132  $pc_def = $this->getPCDefinitionByName($a_name);
133  $pc_class = "ilPC" . $pc_def["name"] . "ModelProvider";
134  if (class_exists($pc_class)) {
135  return new $pc_class();
136  }
137  return null;
138  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPCDefinitionByName(string $a_pc_name)
Get PC definition by name.
+ Here is the call graph for this function:

◆ getRecords()

ILIAS\COPage\PC\PCDefinition::getRecords ( )

Definition at line 42 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\$db, and ilDBInterface\query().

Referenced by ILIAS\COPage\PC\PCDefinition\init().

42  : array
43  {
44  $db = $this->db;
45  $set = $db->query("SELECT * FROM copg_pc_def ORDER BY order_nr");
46  return $db->fetchAll($set);
47  }
fetchAll(ilDBStatement $statement, int $fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ILIAS\COPage\PC\PCDefinition::init ( )
protected

Definition at line 49 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\$db, ILIAS\COPage\PC\PCDefinition\getRecords(), and null.

Referenced by ILIAS\COPage\PC\PCDefinition\getPCDefinitionByGUIClassName(), ILIAS\COPage\PC\PCDefinition\getPCDefinitionByName(), ILIAS\COPage\PC\PCDefinition\getPCDefinitionByType(), ILIAS\COPage\PC\PCDefinition\getPCDefinitions(), ILIAS\COPage\PC\PCDefinition\getPCEditorInstanceByName(), ILIAS\COPage\PC\PCDefinition\getPCModelProviderByName(), and ILIAS\COPage\PC\PCDefinition\isPCGUIClassName().

49  : void
50  {
51  $db = $this->db;
52  if ($this->pc_def == null) {
53  foreach ($this->getRecords() as $rec) {
54  $rec["pc_class"] = "ilPC" . $rec["name"];
55  $rec["pc_gui_class"] = "ilPC" . $rec["name"] . "GUI";
56  $this->pc_gui_classes[] = $rec["pc_gui_class"];
57  $this->pc_gui_classes_lc[] = strtolower($rec["pc_gui_class"]);
58  $this->pc_def[$rec["pc_type"]] = $rec;
59  $this->pc_def_by_name[$rec["name"]] = $rec;
60  $this->pc_def_by_gui_class_cl[strtolower($rec["pc_gui_class"])] = $rec;
61  }
62  }
63  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPCGUIClassName()

ILIAS\COPage\PC\PCDefinition::isPCGUIClassName ( string  $a_class_name,
bool  $a_lower_case = false 
)

Definition at line 101 of file class.PCDefinition.php.

References ILIAS\COPage\PC\PCDefinition\init().

104  : bool {
105  $this->init();
106  if ($a_lower_case) {
107  return in_array($a_class_name, $this->pc_gui_classes_lc);
108  } else {
109  return in_array($a_class_name, $this->pc_gui_classes);
110  }
111  }
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ILIAS\COPage\PC\PCDefinition::$db
protected

◆ $pc_def

array ILIAS\COPage\PC\PCDefinition::$pc_def = []
protected

◆ $pc_def_by_gui_class_cl

array ILIAS\COPage\PC\PCDefinition::$pc_def_by_gui_class_cl = array()
protected

Definition at line 33 of file class.PCDefinition.php.

◆ $pc_def_by_name

array ILIAS\COPage\PC\PCDefinition::$pc_def_by_name = []
protected

Definition at line 30 of file class.PCDefinition.php.

◆ $pc_gui_classes

array ILIAS\COPage\PC\PCDefinition::$pc_gui_classes = array()
protected

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

◆ $pc_gui_classes_lc

array ILIAS\COPage\PC\PCDefinition::$pc_gui_classes_lc = array()
protected

Definition at line 32 of file class.PCDefinition.php.


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