Search in sources :

Example 1 with CourseStaffMemberCreatedEvent

use of fi.otavanopisto.pyramus.events.CourseStaffMemberCreatedEvent in project pyramus by otavanopisto.

the class CourseStaffMemberDAO method create.

public CourseStaffMember create(Course course, StaffMember staffMember, CourseStaffMemberRole role) {
    CourseStaffMember courseStaffMember = new CourseStaffMember();
    courseStaffMember.setCourse(course);
    courseStaffMember.setStaffMember(staffMember);
    courseStaffMember.setRole(role);
    persist(courseStaffMember);
    courseStaffMemberCreatedEvent.fire(new CourseStaffMemberCreatedEvent(courseStaffMember.getId(), courseStaffMember.getCourse().getId(), courseStaffMember.getStaffMember().getId()));
    return courseStaffMember;
}
Also used : CourseStaffMember(fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMember) CourseStaffMemberCreatedEvent(fi.otavanopisto.pyramus.events.CourseStaffMemberCreatedEvent)

Aggregations

CourseStaffMember (fi.otavanopisto.pyramus.domainmodel.courses.CourseStaffMember)1 CourseStaffMemberCreatedEvent (fi.otavanopisto.pyramus.events.CourseStaffMemberCreatedEvent)1