ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Private Attributes
AModule Class Reference
Inheritance diagram for AModule:
Test2Module TestModule

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.

101  {
102  switch ($key)
103  {
104  case "context": return $this->context; break;
105  case "entity": return $this->entity; break;
106  }
107  throw new \Exception("Cannot access attribute {$key}");
108  }
doAction (   $event)
abstract
Parameters
\Tools\HookEvent$eventcalled 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.

95  { return ""; }
getName ( )
Returns
string module name

Definition at line 86 of file AModule.php.

87  {
88  return $this->entity->name;
89  }
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.

79  {
80  $this->context->hookManager->register($this, $hookName);
81  }
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.

57  {
58  if ($this->context === null)
59  $this->context = $context;
60  }
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.

69  {
70  if ($this->entity === null)
71  $this->entity = $entity;
72  }
uninstall ( )

Called on module unsinstall

Definition at line 33 of file AModule.php.

34  { }

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: