ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPageObjectFactory.php
Go to the documentation of this file.
1 <?php
2 
25 {
29  public static function getInstance(
30  string $a_parent_type,
31  int $a_id = 0,
32  int $a_old_nr = 0,
33  string $a_lang = "-"
34  ): ilPageObject {
35  $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
36  $class = $def["class_name"];
37  $obj = new $class($a_id, $a_old_nr, $a_lang);
38 
39  return $obj;
40  }
41 
45  public static function getConfigInstance(
46  string $a_parent_type
47  ): ilPageConfig {
48  $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
49  $class = $def["class_name"] . "Config";
50  $path = "./" . $def["component"] . "/" . $def["directory"] . "/class." . $class . ".php";
51  $cfg = new $class();
52 
53  return $cfg;
54  }
55 
65  /* static function getGUIInstance($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_lang = "-")
66  {
67  $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
68  $class = $def["class_name"]."GUI";
69  $path = "./".$def["component"]."/".$def["directory"]."/class.".$class.".php";
70  if (in_array($a_parent_type, array("cont", "cstr", "lm")))
71  {
72  $obj = new $class($a_id , $a_old_nr, $a_lang);
73  }
74  else if (in_array($a_parent_type, array("impr")))
75  {
76  $obj = new $class();
77  }
78  else if (in_array($a_parent_type, array("stys")))
79  {
80  $obj = new $class($a_parent_type, $a_id, $a_old_nr);
81  }
82  else if (in_array($a_parent_type, array("blog")))
83  {
84  $obj = new $class($a_parent_type, $a_id, $a_old_nr);
85  }
86  else
87  {
88  $obj = new $class($a_id , $a_old_nr);
89  }
90 
91  return $obj;
92  }*/
93 }
static getDefinitionByParentType(string $a_parent_type)
Get definition by parent type.
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static getConfigInstance(string $a_parent_type)
Get page config instance.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.