All Data Structures Namespaces Files Functions Variables
AModule Class Reference
Inheritance diagram for AModule:

## Public Member Functions

| install ()
| uninstall ()
| doAction ($event)
| doShortCode ($shortCode, $params)
| setContext ($context)
| setEntity ($entity)
| registerHook ($hookName)
| getName ()
| getDescription ()
| __get ($key)

## Private Attributes

| $context
| $entity

## Detailed Description

Module superclass Contains all informations about the module

Definition at line 9 of file AModule.php.

## Member Function Documentation

__get | ( |  | $key | ) |

Getter

Definition at line 100 of file AModule.php.

{
switch ($key)
{
case "context": return $this->context; break;
case "entity": return $this->entity; break;
}
throw new \Exception("Cannot access attribute {$key}");
}
Tools\AModule\$context
$context
Definition: AModule.php:17
Tools\AModule\$entity
$entity
Definition: AModule.php:22

doAction | ( |  | $event | ) |

abstract

Parameters

  \Tools\HookEvent | $event | called hook /core/tools/HookEvent.php Called on hook reception

doShortCode | ( |  | $shortCode,
|  |  | $params
| ) |  |

abstract

Parameters

  string | $shortCode |
  | array | ( key => value ) shortcode's parameters Called on shortcode reception

getDescription | ( |  | ) |

Returns
  string module's description

Definition at line 94 of file AModule.php.

{ return ""; }

getName | ( |  | ) |

Returns
  string module name

Definition at line 86 of file AModule.php.

{
return $this->entity->name;
}

install | ( |  | ) |

abstract

Called on module install Should register shortcodes and Hooks

registerHook | ( |  | $hookName | ) |

Register hook to be triggered Can only be triggered while module setup

Definition at line 78 of file AModule.php.

{
$this->context->hookManager->register($this, $hookName);
}

setContext | ( |  | $context | ) |

Parameters

  \Tools\Context | $context | /core/tools/Context.php set the application context Will work only one time

Definition at line 56 of file AModule.php.

{
if ($this->context === null)
$this->context = $context;
}
Tools\AModule\$context
$context
Definition: AModule.php:17

setEntity | ( |  | $entity | ) |

Parameters

  \Entity\Module | $module | /core/models/Module.php set the module database object Will work only one time

Definition at line 68 of file AModule.php.

{
if ($this->entity === null)
$this->entity = $entity;
}
Tools\AModule\$entity
$entity
Definition: AModule.php:22

uninstall | ( |  | ) |

Called on module unsinstall

Definition at line 33 of file AModule.php.

{ }

## Field Documentation

Tools Context $context

private

/core/tools/Context.php Website context Can be accessed read-only

Definition at line 17 of file AModule.php.

$entity

private

Definition at line 22 of file AModule.php.

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

- core/tools/AModule.php