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
- The Pluggable Model controller should extend
StandardPluggableController
. - The Pluggable Model should define a
plugin
field, which specifies the instantiated Plugin Model. - The Pluggable Model table should use
\App\Lib\Traits\PluggableModelTrait
and call$this->setPluginRelations()
in the table'sinitialize()
function. This call will bind the Pluggable Model to its instantiated Plugin Models. - A column definition should be added to the
schema.json
columnLibrary
so that plugin schemas can easily define foreign key references.
Common Functionality
- 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 theedit
view for the instantiated Plugin Model. - When the Pluggable Model's
fields.inc
file references theplugin
field,FieldHelper
will automatically render the field as a dropdown foradd
, but onedit
it will render a read-only field with a link to theconfigure
URL described above. - When the instance of the Pluggable Model is deleted, the instantiated Plugin Model will also be deleted (via
setPluginRelations()
).