function quantity_quantity_presave in farmOS 2.x
Implements hook_ENTITY_TYPE_presave().
File
- modules/
core/ quantity/ quantity.module, line 129 - Quantity module.
Code
function quantity_quantity_presave(QuantityInterface $quantity) {
// Dispatch an event on quantity presave.
// @todo Replace this with core event via https://www.drupal.org/node/2551893.
$event = new QuantityEvent($quantity);
$event_dispatcher = \Drupal::service('event_dispatcher');
$event_dispatcher
->dispatch(QuantityEvent::PRESAVE, $event);
}