Lines 17-30
package Koha::Course;
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
|
|
|
21 |
use base qw(Koha::Object); |
20 |
use base qw(Koha::Object); |
22 |
|
21 |
|
23 |
=head1 NAME |
22 |
=head1 NAME |
24 |
|
23 |
|
25 |
Koha::Course - Koha Course Object class |
24 |
Koha::Course - Koha Course Object class |
26 |
|
25 |
|
27 |
=head1 API |
26 |
=head2 Relations |
|
|
27 |
|
28 |
=head3 instructors |
29 |
|
30 |
my $instructors = $course->instructors(); |
31 |
|
32 |
Returns the related Koha::Patrons object containing the instructors for this course |
33 |
|
34 |
=cut |
35 |
|
36 |
sub instructors { |
37 |
my ($self) = @_; |
38 |
|
39 |
my $instructors = Koha::Patrons->search( |
40 |
{ 'course_instructors.course_id' => $self->course_id }, |
41 |
{ join => 'course_instructors' } ); |
42 |
|
43 |
return $instructors; |
44 |
} |
45 |
|
28 |
|
46 |
|
29 |
=head2 Internal methods |
47 |
=head2 Internal methods |
30 |
|
48 |
|