Create a gist now

Instantly share code, notes, and snippets.

<?php
namespace Drupal\sitemanager\Plugin;
use Drupal\Component\Plugin\PluginInspectionInterface;
/**
* Defines an interface for Task plugin plugins.
*/
interface TaskPluginInterface extends PluginInspectionInterface {
/**
* Return the name of the task.
*
* @return string
* returns the name as a string.
*/
public function getTaskName();
/**
* Returns the status of the task defined by this plugin.
*
* @return string
* Returns: "Success" or "Error".
*/
public function getTaskStatus();
/**
* Builds and returns a render array for the task.
*
* @return array
* Returns a render array for the output of the task;
*/
public function getTaskOutput();
/**
* Runs the task (is the definition of the task).
*
* @param Site $site
* The site entity to be used.
*
* @return string
* Returns: getTaskStatus();
*/
public function run(Site $site);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment