public function PostInstall::getInstallTasks in Group 2.0.x
Retrieves the tasks to run after plugin installation.
It's really important that you only return tasks to run rather than run tasks directly. The former approach allows other modules to disable or change your task whereas the latter approach makes the decorator approach we're using for handlers fall short.
Return value
array A list of callables as accepted by call_user_func_array(), preferably keyed by a human-readable name so that other modules can easily find your callback if they wish to change it.
The callbacks will receive 2 arguments:
- The GroupContentTypeInterface created by installing the plugin.
- A boolean indicating whether the config is syncing. If TRUE, do not add any one-off config because they will already be added by the sync.
Overrides PostInstallTrait::getInstallTasks
File
- src/
Plugin/ Group/ RelationHandlerDefault/ PostInstall.php, line 18
Class
- PostInstall
- Provides post install tasks for group relation plugins.
Namespace
Drupal\group\Plugin\Group\RelationHandlerDefaultCode
public function getInstallTasks() {
// By default, plugins have nothing to do after installation.
return [];
}