@@ -, +, @@ --- Koha/Course.pm | 22 ++++++++++++++++++++-- course_reserves/course-details.pl | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) --- a/Koha/Course.pm +++ a/Koha/Course.pm @@ -17,14 +17,32 @@ package Koha::Course; use Modern::Perl; - use base qw(Koha::Object); =head1 NAME Koha::Course - Koha Course Object class -=head1 API +=head2 Relations + +=head3 instructors + + my $instructors = $course->instructors(); + +Returns the related Koha::Patrons object containing the instructors for this course + +=cut + +sub instructors { + my ($self) = @_; + + my $instructors = Koha::Patrons->search( + { 'course_instructors.course_id' => $self->course_id }, + { join => 'course_instructors' } ); + + return $instructors; +} + =head2 Internal methods --- a/course_reserves/course-details.pl +++ a/course_reserves/course-details.pl @@ -56,7 +56,7 @@ elsif ( $action eq 'rm_all' ) { } } -my $course = GetCourse($course_id); +my $course = Koha::Courses->find( $course_id ); my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, --