Skip to content
Viames Marino edited this page Feb 23, 2026 · 1 revision

Pair framework: Module

Pair\Models\Module represents an installable module plugin.

Main methods

  • getBaseFolder(): string
  • getPlugin(): Plugin
  • storeByPlugin(SimpleXMLElement $options): bool

Lifecycle hooks:

  • _init() defines schema and validation
  • beforeDelete() performs module cleanup

Implementation example

$module = \Pair\Models\Module::findById($id);

if ($module && $module->isCompatibleWithApp()) {
    $plugin = $module->getPlugin();
    // use plugin metadata or install/update helpers
}

Notes

  • Extends PluginBase, so it inherits compatibility checks.
  • Integrates with plugin manifest options when storing.

See also: Plugin, PluginBase, Template.

Clone this wiki locally