ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilChatroomObjectDefinition Class Reference
+ Collaboration diagram for ilChatroomObjectDefinition:

Public Member Functions

 __construct (private readonly string $moduleName, string $moduleBasePath, string $relativeClassPath='classes', string $guiScope='')
 
 hasGUI (string $gui)
 Returns true if file exists. More...
 
 getGUIPath (string $gui)
 Builds gui path using given $gui and returns it. More...
 
 getGUIClassName (string $gui)
 Builds gui classname using given $gui and returns it. More...
 
 loadGUI (string $gui)
 Requires file, whereby given $gui is used as parameter in getGUIPath method to build the filename of the file to required. More...
 
 buildGUI (string $gui, ilChatroomObjectGUI $chatroomObjectGUI)
 Builds and returns new gui using given $gui and $gui. More...
 

Static Public Member Functions

static getDefaultDefinition (string $moduleName)
 Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter. More...
 
static getDefaultDefinitionWithCustomGUIPath (string $moduleName, string $guiScope='')
 Returns an Instance of ilChatroomObjectDefinition, using given $moduleName and $guiScope as parameters. More...
 

Private Attributes

readonly string $moduleBasePath
 
readonly string $relativeClassPath
 
readonly string $guiScope
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomObjectDefinition::__construct ( private readonly string  $moduleName,
string  $moduleBasePath,
string  $relativeClassPath = 'classes',
string  $guiScope = '' 
)
Parameters
$moduleNameModule name, defaults to 'Chatroom'

Definition at line 45 of file class.ilChatroomObjectDefinition.php.

53  {
54  $this->moduleBasePath = rtrim($moduleBasePath, '/\\');
55  $this->relativeClassPath = rtrim($relativeClassPath);
56  $this->guiScope = rtrim($guiScope);
57  }

Member Function Documentation

◆ buildGUI()

ilChatroomObjectDefinition::buildGUI ( string  $gui,
ilChatroomObjectGUI  $chatroomObjectGUI 
)

Builds and returns new gui using given $gui and $gui.

Definition at line 123 of file class.ilChatroomObjectDefinition.php.

References getGUIClassName().

124  {
125  $className = $this->getGUIClassName($gui);
126  return new $className($chatroomObjectGUI);
127  }
Class ilChatroomGUIHandler.
getGUIClassName(string $gui)
Builds gui classname using given $gui and returns it.
+ Here is the call graph for this function:

◆ getDefaultDefinition()

static ilChatroomObjectDefinition::getDefaultDefinition ( string  $moduleName)
static

Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.

Definition at line 63 of file class.ilChatroomObjectDefinition.php.

Referenced by ilObjChatroomGUI\getObjectDefinition().

63  : self
64  {
65  return new self($moduleName, 'Modules/' . $moduleName . '/');
66  }
+ Here is the caller graph for this function:

◆ getDefaultDefinitionWithCustomGUIPath()

static ilChatroomObjectDefinition::getDefaultDefinitionWithCustomGUIPath ( string  $moduleName,
string  $guiScope = '' 
)
static

Returns an Instance of ilChatroomObjectDefinition, using given $moduleName and $guiScope as parameters.

Parameters
string$guiScopeOptional. 'admin' or ''. Default ''

Definition at line 73 of file class.ilChatroomObjectDefinition.php.

References $guiScope.

Referenced by ilObjChatroomAdminGUI\getObjectDefinition().

73  : self
74  {
75  return new self(
76  $moduleName,
77  'Modules/' . $moduleName . '/',
78  'classes',
79  $guiScope
80  );
81  }
+ Here is the caller graph for this function:

◆ getGUIClassName()

ilChatroomObjectDefinition::getGUIClassName ( string  $gui)

Builds gui classname using given $gui and returns it.

Definition at line 106 of file class.ilChatroomObjectDefinition.php.

Referenced by buildGUI(), and getGUIPath().

106  : string
107  {
108  return 'il' . $this->moduleName . ucfirst($this->guiScope) . ucfirst($gui) . 'GUI';
109  }
+ Here is the caller graph for this function:

◆ getGUIPath()

ilChatroomObjectDefinition::getGUIPath ( string  $gui)

Builds gui path using given $gui and returns it.

Definition at line 94 of file class.ilChatroomObjectDefinition.php.

References getGUIClassName().

Referenced by hasGUI(), and loadGUI().

94  : string
95  {
96  return (
97  $this->moduleBasePath . '/' .
98  $this->relativeClassPath . '/' .
99  $this->guiScope . 'gui/class.' . $this->getGUIClassName($gui) . '.php'
100  );
101  }
getGUIClassName(string $gui)
Builds gui classname using given $gui and returns it.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasGUI()

ilChatroomObjectDefinition::hasGUI ( string  $gui)

Returns true if file exists.

Definition at line 86 of file class.ilChatroomObjectDefinition.php.

References getGUIPath().

86  : bool
87  {
88  return is_file($this->getGUIPath($gui));
89  }
getGUIPath(string $gui)
Builds gui path using given $gui and returns it.
+ Here is the call graph for this function:

◆ loadGUI()

ilChatroomObjectDefinition::loadGUI ( string  $gui)

Requires file, whereby given $gui is used as parameter in getGUIPath method to build the filename of the file to required.

Definition at line 115 of file class.ilChatroomObjectDefinition.php.

References getGUIPath().

115  : void
116  {
117  require_once $this->getGUIPath($gui);
118  }
getGUIPath(string $gui)
Builds gui path using given $gui and returns it.
+ Here is the call graph for this function:

Field Documentation

◆ $guiScope

readonly string ilChatroomObjectDefinition::$guiScope
private

◆ $moduleBasePath

readonly string ilChatroomObjectDefinition::$moduleBasePath
private

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

◆ $relativeClassPath

readonly string ilChatroomObjectDefinition::$relativeClassPath
private

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


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