在 PHP 中,在 Doctrine 实体中使用事件总线
你有多少次看到过这样写的代码呢? public function assignTeacherAction( SubjectInterface $subject, TeacherInterface $teacher ): JsonResponse { $subject->assignTeacher($teacher); $this->entityManager->flush(); $this->logTeacherAssignedToSubject($subject, $teacher); $this->notifyTeacher($s