*/ class RemoveRelated implements AfterRemove { public function __construct( private EntityManager $entityManager, ) {} public function afterRemove(Entity $entity, RemoveOptions $options): void { $query = UpdateBuilder::create() ->in(BpmnFlowNode::ENTITY_TYPE) ->where([ BpmnFlowNode::ATTR_PROCESS_ID => $entity->getId(), ]) ->set([ Attribute::DELETED => true, 'modifiedAt' => DateTime::createNow()->toString(), ]) ->build(); $this->entityManager->getQueryExecutor()->execute($query); } }