Skip to content

Instantly share code, notes, and snippets.

@acrosman
Created January 8, 2017 19:16
Show Gist options
  • Save acrosman/e002ad2c529820271e09de58fc71307f to your computer and use it in GitHub Desktop.
Save acrosman/e002ad2c529820271e09de58fc71307f to your computer and use it in GitHub Desktop.
<?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