protected function InvoiceStorage::invokeHook in Commerce Invoice 8.2
Invokes a hook on behalf of the entity.
Parameters
string $hook: One of 'create', 'presave', 'insert', 'update', 'predelete', 'delete', or 'revision_delete'.
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
Overrides CommerceContentEntityStorage::invokeHook
File
- src/
InvoiceStorage.php, line 17
Class
Namespace
Drupal\commerce_invoiceCode
protected function invokeHook($hook, EntityInterface $entity) {
if ($hook == 'presave') {
// Invoice::preSave() has completed, now run the storage-level pre-save
// tasks. These tasks can modify the invoice, so they need to run
// before the entity/field hooks are invoked.
$this
->doInvoicePresave($entity);
}
parent::invokeHook($hook, $entity);
}