Module - viames/pair GitHub Wiki

Pair framework: Module

Pair\Models\Module represents an installable module package record.

Main methods

  • getPackageBaseFolder(): string
  • getInstallablePackage(): InstallablePackage
  • storeFromPackageManifest(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()) {
    $package = $module->getInstallablePackage();
    // use package metadata or download helpers
}

Notes

  • Extends InstallablePackageRecord, so it inherits compatibility checks.
  • Integrates with package manifest options when storing.

See also: InstallablePackage, InstallablePackageRecord, Template.