Main module class - Jet\Application_Module

Every module must have a Main class, and it must be a descendant of that class (or of another class that is a descendant of that class).

The Main class is like a gateway to the module and therefore provides several necessary methods.

Method Meaning of
public __construct(
Application_Module_Manifest $manifest
)
The constructor only takes an instance of manifest, which is further instantiated by the main module class. It does not perform any other operations.
public getModuleManifest(
): Application_Module_Manifest
Returns an instance of the manifest module.
public install(
): void
Performs the module installation. It calls the installation script, if it exists, and also calls the translator to install dictionaries (if the module has any).

It no longer handles storing meta-information about installed modules. That's handled by handler.
public uninstall(
): void
Deinstall the module. It calls the uninstall script if it exists and also calls the translator with a request to delete the dictionaries that the application module has installed.

It no longer handles the storage of meta-information about installed modules. That's handled by the handler.
public getViewsDir(
): string
Returns the full path to the directory where the view scripts belonging to the module are located.
public actionIsAllowed(
string $action
): bool
Verifies whether the ACL action is enabled (authorized - that is, whether the user has sufficient permissions). The default implementation verifies the existence of such an action and calls the authorization subsystem.

Of course, you have the option to overload all methods if you need to.

Previous chapter
Module Manifest - Jet\Application_Module_Manifest
Next chapter
ORM DataModel