You are here

class DeleteOrphan in Organic groups 8

Deletes orphaned group content.

Plugin annotation


@QueueWorker(
  id = "og_orphaned_group_content_cron",
  title = @Translation("Delete orphaned group content"),
  cron = {"time" = 60}
)

Hierarchy

Expanded class hierarchy of DeleteOrphan

File

src/Plugin/QueueWorker/DeleteOrphan.php, line 21

Namespace

Drupal\og\Plugin\QueueWorker
View source
class DeleteOrphan extends QueueWorkerBase implements ContainerFactoryPluginInterface {

  /**
   * The plugin manager for OgDeleteOrphans plugins.
   *
   * @var \Drupal\og\OgDeleteOrphansPluginManager
   */
  protected $ogDeleteOrphansPluginManager;

  /**
   * Constructs a DeleteOrphan object.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\og\OgDeleteOrphansPluginManager $og_delete_orphans_plugin_manager
   *   The plugin manager for OgDeleteOrphans plugins.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, OgDeleteOrphansPluginManager $og_delete_orphans_plugin_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->ogDeleteOrphansPluginManager = $og_delete_orphans_plugin_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('plugin.manager.og.delete_orphans'));
  }

  /**
   * {@inheritdoc}
   */
  public function processItem($data) {
    $this->ogDeleteOrphansPluginManager
      ->createInstance('cron', [])
      ->processItem($data);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeleteOrphan::$ogDeleteOrphansPluginManager protected property The plugin manager for OgDeleteOrphans plugins.
DeleteOrphan::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
DeleteOrphan::processItem public function Works on a single queue item. Overrides QueueWorkerInterface::processItem
DeleteOrphan::__construct public function Constructs a DeleteOrphan object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.