/**
  * {@inheritdoc}
  */
 protected function invokeHook($hook, EntityInterface $entity)
 {
     /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
     switch ($hook) {
         case 'presave':
             $this->invokeFieldMethod('preSave', $entity);
             break;
         case 'insert':
             $this->invokeFieldPostSave($entity, FALSE);
             break;
         case 'update':
             $this->invokeFieldPostSave($entity, TRUE);
             break;
     }
     parent::invokeHook($hook, $entity);
 }
 /**
  * {@inheritdoc}
  */
 protected function invokeHook($hook, EntityInterface $entity)
 {
     if ($hook == 'presave') {
         $this->invokeFieldMethod('preSave', $entity);
     }
     parent::invokeHook($hook, $entity);
 }