class DisabledStockEvents in Commerce Stock 8
Core Stock Events.
Plugin annotation
@StockEvents(
id = "disabled_stock_events",
description = @Translation("Disabled all stock events."),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\commerce_stock\Plugin\StockEvents\DisabledStockEvents implements StockEventsInterface
Expanded class hierarchy of DisabledStockEvents
File
- src/
Plugin/ StockEvents/ DisabledStockEvents.php, line 20
Namespace
Drupal\commerce_stock\Plugin\StockEventsView 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;
}
}