ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilChatroomObjectDefinition Class Reference
+ Collaboration diagram for ilChatroomObjectDefinition:

Public Member Functions

 __construct ($moduleName, $moduleBasePath, $relativeClassPath='classes', $relativeTaskPath='tasks')
 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, $relativeTaskFolder)
 Returns an Instance of ilChatroomObjectDefinition, using given $moduleName and $relativeTaskFolder as parameters. More...
 

Private Attributes

 $moduleName
 
 $moduleBasePath
 
 $relativeClassPath
 
 $relativeTaskPath
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Sets class parameters using given parameters.

Parameters
string$moduleName
string$moduleBasePath
string$relativeClassPath
string$relativeTaskPath

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

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

37  {
38  $this->moduleName = $moduleName;
39  $this->moduleBasePath = rtrim($moduleBasePath, '/\\');
40  $this->relativeClassPath = rtrim($relativeClassPath);
41  $this->relativeTaskPath = rtrim($relativeTaskPath);
42  }

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 100 of file class.ilChatroomObjectDefinition.php.

References getTaskClassName().

101  {
102  $className = $this->getTaskClassName($task);
103  $task = new $className($gui);
104 
105  return $task;
106  }
getTaskClassName($task)
Builds task classname using given $task and returns it.
+ 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 50 of file class.ilChatroomObjectDefinition.php.

References $moduleName.

Referenced by ilObjChatroomGUI\getObjectDefinition().

51  {
52  $object = new self($moduleName, 'Modules/' . $moduleName . '/');
53 
54  return $object;
55  }
+ Here is the caller graph for this function:

◆ getDefaultDefinitionWithCustomTaskPath()

static ilChatroomObjectDefinition::getDefaultDefinitionWithCustomTaskPath (   $moduleName,
  $relativeTaskFolder 
)
static

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

Parameters
string$moduleName
string$relativeTaskFolder
Returns
ilChatroomObjectDefinition

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

References $moduleName.

Referenced by ilObjChatroomAdminGUI\getObjectDefinition().

65  {
66  $object = new self(
67  $moduleName, 'Modules/' . $moduleName . '/', 'classes', $relativeTaskFolder
68  );
69 
70  return $object;
71  }
+ 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 113 of file class.ilChatroomObjectDefinition.php.

Referenced by buildTask(), and getTaskPath().

114  {
115  return 'il' . $this->moduleName . ucfirst($task) . 'Task';
116  }
+ 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 123 of file class.ilChatroomObjectDefinition.php.

References getTaskClassName().

Referenced by hasTask(), and loadTask().

124  {
125  return $this->moduleBasePath . '/' . $this->relativeClassPath . '/' .
126  $this->relativeTaskPath . '/class.' . $this->getTaskClassName($task) . '.php';
127  }
getTaskClassName($task)
Builds task classname using given $task and returns it.
+ 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 78 of file class.ilChatroomObjectDefinition.php.

References getTaskPath().

79  {
80  return file_exists($this->getTaskPath($task));
81  }
getTaskPath($task)
Builds task path using given $task and returns it.
+ 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 88 of file class.ilChatroomObjectDefinition.php.

References getTaskPath().

89  {
90  require_once $this->getTaskPath($task);
91  }
getTaskPath($task)
Builds task path using given $task and returns it.
+ Here is the call graph for this function:

Field Documentation

◆ $moduleBasePath

ilChatroomObjectDefinition::$moduleBasePath
private

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

Referenced by __construct().

◆ $moduleName

ilChatroomObjectDefinition::$moduleName
private

◆ $relativeClassPath

ilChatroomObjectDefinition::$relativeClassPath
private

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

Referenced by __construct().

◆ $relativeTaskPath

ilChatroomObjectDefinition::$relativeTaskPath
private

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

Referenced by __construct().


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