All Data Structures Namespaces Files Functions Variables
AModule.php
Go to the documentation of this file.
<?php
namespace Tools;
abstract class AModule
{
private $context;
private $entity;
public abstract function install();
public function uninstall()
{ }
public abstract function doAction($event);
public abstract function doShortCode($shortCode, $params);
public function setContext($context)
{
if ($this->context === null)
$this->context = $context;
}
public function setEntity($entity)
{
if ($this->entity === null)
$this->entity = $entity;
}
public function registerHook($hookName)
{
$this->context->hookManager->register($this, $hookName);
}
public function getName()
{
return $this->entity->name;
}
public function getDescription()
{ return ""; }
public function __get($key)
{
switch ($key)
{
case "context": return $this->context; break;
case "entity": return $this->entity; break;
}
throw new \Exception("Cannot access attribute {$key}");
}
}
Tools\AModule\__get
__get($key)
Definition: AModule.php:100
Tools\AModule\$context
$context
Definition: AModule.php:17
Tools\AModule\getDescription
getDescription()
Definition: AModule.php:94
Tools\AModule\getName
getName()
Definition: AModule.php:86
Tools\AModule\uninstall
uninstall()
Definition: AModule.php:33
Tools\AModule
Definition: AModule.php:9
Tools\AModule\setContext
setContext($context)
Definition: AModule.php:56
Tools\AModule\registerHook
registerHook($hookName)
Definition: AModule.php:78
Tools\AModule\$entity
$entity
Definition: AModule.php:22
Tools
Definition: AController.php:3
Tools\AModule\setEntity
setEntity($entity)
Definition: AModule.php:68