Pluggable Models are core Registry model that understands Registry Plugins of a given type, such as ExternalIdentitySource or Report. Because there is a lot of functional overlap in instantiating plugins, Registry PE includes utilities for simplifying the creation of new Pluggable Models.

Pluggable Model Requirements

  1. The Pluggable Model controller should extend StandardPluggableController.
  2. The Pluggable Model should define a plugin field, which specifies the instantiated Plugin Model.
  3. The Pluggable Model table should use \App\Lib\Traits\PluggableModelTrait and call $this->setPluginRelations() in the table's initialize() function. This call will bind the Pluggable Model to its instantiated Plugin Models.
  4. A column definition should be added to the schema.json columnLibrary so that plugin schemas can easily define foreign key references.

Common Functionality

  1. When a new instance of a Pluggable Model is added, StandardController will create a new, skeletal record for the selected Plugin Model (AR-Plugin-9). The user will then be redirected to /pluggable-models/configure/#, which in turn will redirect to the edit view for the instantiated Plugin Model.
  2. When the Pluggable Model's fields.inc file references the plugin field, FieldHelper will automatically render the field as a dropdown for add, but on edit it will render a read-only field with a link to the configure URL described above.
  3. When the instance of the Pluggable Model is deleted, the instantiated Plugin Model will also be deleted (via setPluginRelations()).

See Also

  • No labels