You are here

class DisabledStockEvents in Commerce Stock 8

Core Stock Events.

Plugin annotation


@StockEvents(
  id = "disabled_stock_events",
  description = @Translation("Disabled all stock events."),
)

Hierarchy

Expanded class hierarchy of DisabledStockEvents

File

src/Plugin/StockEvents/DisabledStockEvents.php, line 20

Namespace

Drupal\commerce_stock\Plugin\StockEvents
View source
class DisabledStockEvents extends PluginBase implements StockEventsInterface {

  /**
   * {@inheritdoc}
   */
  public function stockEvent(Context $context, PurchasableEntityInterface $entity, $stockEvent, $quantity, StockLocationInterface $location, $transaction_type, array $metadata) {

    // This does nothing.
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function configFormOptions() {

    // No configuration.
    $form['na'] = [
      '#type' => 'markup',
      '#markup' => t('No configuration options.'),
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function saveConfigFormOptions(array $form, FormStateInterface $form_state) {

    // Nothing to do.
    return FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DisabledStockEvents::configFormOptions public function Return form elements holding the configuration options. Overrides StockEventsInterface::configFormOptions
DisabledStockEvents::saveConfigFormOptions public function Save the configuration options. Overrides StockEventsInterface::saveConfigFormOptions
DisabledStockEvents::stockEvent public function A stock event with transaction details. Overrides StockEventsInterface::stockEvent
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.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 92
StockEventsInterface::ORDER_CANCEL_EVENT constant
StockEventsInterface::ORDER_DELET_EVENT constant
StockEventsInterface::ORDER_ITEM_DELETE_EVENT constant
StockEventsInterface::ORDER_ITEM_UPDATE_EVENT constant
StockEventsInterface::ORDER_PLACE_EVENT constant
StockEventsInterface::ORDER_UPDATE_EVENT constant