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 static function registerHook($hookName) { $this->context->hooks->register($this, $hookname); } /** * 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}"); } }