protected function triggerAfterSave(
        Save $saveEvent, EntityInterface $entity
    ) {
        $afterSave = clone $saveEvent;
        $action = $afterSave->getName() == Save::ACTION_BEFORE_INSERT
            ? Save::ACTION_AFTER_INSERT
            : Save::ACTION_AFTER_UPDATE;

        $afterSave->setEntity($entity)->setAction($action);
        return Orm::getEmitter($this->getEntityClassName())
            ->emit($afterSave);
    }