value ) shortcode's parameters * Called on shortcode reception **/ public abstract function doShortCode($shortCode, $params); /** * @param \Tools\Context $context * /core/tools/Context.php * set the application context * Will work only one time **/ public function setContext($context) { if ($this->context === null) $this->context = $context; } /** * @param \Entity\Module $module * /core/models/Module.php * set the module database object * Will work only one time **/ public function setEntity($entity) { if ($this->entity === null) $this->entity = $entity; } /** * Register hook to be triggered * Can only be triggered while module setup **/ public function registerHook($hookName) { $this->context->hookManager->register($this, $hookName); } /** * @return string module name **/ public function getName() { return $this->entity->name; } /** * @return string module's description **/ public function getDescription() { return ""; } /** * Getter **/ 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}"); } }