ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDBayObjectDefinition Class Reference

Description of class. More...

+ Collaboration diagram for ilDBayObjectDefinition:

Public Member Functions

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

Static Public Member Functions

static getDefaultDefinition ($moduleName)
 Returns an Instance of ilDBayObjectDefinition, using given $moduleName as parameter.
static getDefaultDefinitionWithCustomTaskPath ($moduleName, $relativeTaskFolder)
 Returns an Instance of ilDBayObjectDefinition, using given $moduleName and $relativeTaskFolder as parameters.

Private Attributes

 $moduleName
 $moduleBasePath
 $relativeClassPath
 $relativeTaskPath

Detailed Description

Description of class.

Author
jposselt

Definition at line 13 of file class.ilDBayObjectDefinition.php.

Constructor & Destructor Documentation

ilDBayObjectDefinition::__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 29 of file class.ilDBayObjectDefinition.php.

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

{
$this->moduleName = $moduleName;
$this->moduleBasePath = rtrim( $moduleBasePath, '/\\' );
$this->relativeClassPath = rtrim( $relativeClassPath );
$this->relativeTaskPath = rtrim( $relativeTaskPath );
}

Member Function Documentation

ilDBayObjectDefinition::buildTask (   $task,
ilDBayObjectGUI  $gui 
)

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

Parameters
className$task
ilDBayObjectGUI$gui
Returns
className

Definition at line 98 of file class.ilDBayObjectDefinition.php.

References getTaskClassName().

{
$className = $this->getTaskClassName( $task );
$task = new $className( $gui );
return $task;
}

+ Here is the call graph for this function:

static ilDBayObjectDefinition::getDefaultDefinition (   $moduleName)
static

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

Parameters
string$moduleName
Returns
ilDBayObjectDefinition

Definition at line 44 of file class.ilDBayObjectDefinition.php.

References $moduleName.

Referenced by ilObjChatroomGUI\getObjectDefinition().

{
$object = new self( $moduleName, 'Modules/' . $moduleName . '/' );
return $object;
}

+ Here is the caller graph for this function:

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

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

Parameters
string$moduleName
string$relativeTaskFolder
Returns
ilDBayObjectDefinition

Definition at line 59 of file class.ilDBayObjectDefinition.php.

References $moduleName.

Referenced by ilObjChatroomAdminGUI\getObjectDefinition().

{
$object = new self(
$moduleName, 'Modules/' . $moduleName . '/', 'classes', $relativeTaskFolder
);
return $object;
}

+ Here is the caller graph for this function:

ilDBayObjectDefinition::getTaskClassName (   $task)

Builds task classname using given $task and returns it.

Parameters
string$task
Returns
string

Definition at line 112 of file class.ilDBayObjectDefinition.php.

Referenced by buildTask(), and getTaskPath().

{
return 'il' . $this->moduleName . ucfirst( $task ) . 'Task';
}

+ Here is the caller graph for this function:

ilDBayObjectDefinition::getTaskPath (   $task)

Builds task path using given $task and returns it.

Parameters
string$task
Returns
string

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

References getTaskClassName().

Referenced by hasTask(), and loadTask().

{
return $this->moduleBasePath . '/' . $this->relativeClassPath . '/' .
$this->relativeTaskPath . '/class.' . $this->getTaskClassName( $task ) . '.php';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDBayObjectDefinition::hasTask (   $task)

Returns true if file exists.

Parameters
string$task
Returns
boolean

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

References getTaskPath().

{
return file_exists( $this->getTaskPath( $task ) );
}

+ Here is the call graph for this function:

ilDBayObjectDefinition::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 85 of file class.ilDBayObjectDefinition.php.

References getTaskPath().

{
require_once $this->getTaskPath( $task );
}

+ Here is the call graph for this function:

Field Documentation

ilDBayObjectDefinition::$moduleBasePath
private

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

Referenced by __construct().

ilDBayObjectDefinition::$moduleName
private
ilDBayObjectDefinition::$relativeClassPath
private

Definition at line 18 of file class.ilDBayObjectDefinition.php.

Referenced by __construct().

ilDBayObjectDefinition::$relativeTaskPath
private

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

Referenced by __construct().


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