ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilChatroomObjectDefinition Class Reference
+ Collaboration diagram for ilChatroomObjectDefinition:

Public Member Functions

 __construct ($moduleName, $moduleBasePath, $relativeClassPath='classes', $taskScope='')
 Sets class parameters using given parameters. More...
 
 hasTask ($task)
 Returns true if file exists. More...
 
 loadTask ($task)
 Requires file, whereby given $task is used as parameter in getTaskPath method to build the filename of the file to required. More...
 
 buildTask ($task, ilChatroomObjectGUI $gui)
 Builds and returns new task using given $task and $gui. More...
 
 getTaskClassName ($task)
 Builds task classname using given $task and returns it. More...
 
 getTaskPath ($task)
 Builds task path using given $task and returns it. More...
 

Static Public Member Functions

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

Private Attributes

 $moduleName
 
 $moduleBasePath
 
 $relativeClassPath
 
 $taskScope
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomObjectDefinition::__construct (   $moduleName,
  $moduleBasePath,
  $relativeClassPath = 'classes',
  $taskScope = '' 
)

Sets class parameters using given parameters.

Parameters
string$moduleName
string$moduleBasePath
string$relativeClassPathOptional.
string$taskScopeOptional.

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

References $moduleBasePath, $moduleName, $relativeClassPath, and $taskScope.

42  {
43  $this->moduleName = $moduleName;
44  $this->moduleBasePath = rtrim($moduleBasePath, '/\\');
45  $this->relativeClassPath = rtrim($relativeClassPath);
46  $this->taskScope = rtrim($taskScope);
47  }

Member Function Documentation

◆ buildTask()

ilChatroomObjectDefinition::buildTask (   $task,
ilChatroomObjectGUI  $gui 
)

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

Parameters
string$task
ilChatroomObjectGUI$gui
Returns
ilChatroomTaskHandler

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

References $task, and getTaskClassName().

106  {
107  $className = $this->getTaskClassName($task);
108  $task = new $className($gui);
109 
110  return $task;
111  }
getTaskClassName($task)
Builds task classname using given $task and returns it.
$task
GENERAL INFORMATION:
+ Here is the call graph for this function:

◆ getDefaultDefinition()

static ilChatroomObjectDefinition::getDefaultDefinition (   $moduleName)
static

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

Parameters
string$moduleName
Returns
ilChatroomObjectDefinition

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

References $moduleName.

Referenced by ilObjChatroomGUI\getObjectDefinition().

56  {
57  $object = new self($moduleName, 'Modules/' . $moduleName . '/');
58 
59  return $object;
60  }
+ Here is the caller graph for this function:

◆ getDefaultDefinitionWithCustomTaskPath()

static ilChatroomObjectDefinition::getDefaultDefinitionWithCustomTaskPath (   $moduleName,
  $taskScope = '' 
)
static

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

Parameters
string$moduleName
string$taskScopeOptional. 'admin' or ''. Default ''
Returns
ilChatroomObjectDefinition

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

References $moduleName, and $taskScope.

Referenced by ilObjChatroomAdminGUI\getObjectDefinition().

70  {
71  $object = new self(
72  $moduleName, 'Modules/' . $moduleName . '/', 'classes', $taskScope
73  );
74 
75  return $object;
76  }
+ Here is the caller graph for this function:

◆ getTaskClassName()

ilChatroomObjectDefinition::getTaskClassName (   $task)

Builds task classname using given $task and returns it.

Parameters
string$task
Returns
string

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

References $task.

Referenced by buildTask(), and getTaskPath().

119  {
120  return 'il' . $this->moduleName . ucfirst($this->taskScope) . ucfirst($task) . 'Task';
121  }
$task
GENERAL INFORMATION:
+ Here is the caller graph for this function:

◆ getTaskPath()

ilChatroomObjectDefinition::getTaskPath (   $task)

Builds task path using given $task and returns it.

Parameters
string$task
Returns
string

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

References $task, and getTaskClassName().

Referenced by hasTask(), and loadTask().

129  {
130  return $this->moduleBasePath . '/' . $this->relativeClassPath . '/' .
131  $this->taskScope . 'tasks/class.' . $this->getTaskClassName($task) . '.php';
132  }
getTaskClassName($task)
Builds task classname using given $task and returns it.
$task
GENERAL INFORMATION:
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTask()

ilChatroomObjectDefinition::hasTask (   $task)

Returns true if file exists.

Parameters
string$task
Returns
boolean

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

References $task, and getTaskPath().

84  {
85  return file_exists($this->getTaskPath($task));
86  }
getTaskPath($task)
Builds task path using given $task and returns it.
$task
GENERAL INFORMATION:
+ Here is the call graph for this function:

◆ loadTask()

ilChatroomObjectDefinition::loadTask (   $task)

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

Parameters
string$task

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

References $task, and getTaskPath().

94  {
95  require_once $this->getTaskPath($task);
96  }
getTaskPath($task)
Builds task path using given $task and returns it.
$task
GENERAL INFORMATION:
+ Here is the call graph for this function:

Field Documentation

◆ $moduleBasePath

ilChatroomObjectDefinition::$moduleBasePath
private

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

Referenced by __construct().

◆ $moduleName

ilChatroomObjectDefinition::$moduleName
private

◆ $relativeClassPath

ilChatroomObjectDefinition::$relativeClassPath
private

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

Referenced by __construct().

◆ $taskScope

ilChatroomObjectDefinition::$taskScope
private

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