Lines 1-4
Link Here
|
1 |
|
|
|
2 |
package Koha::Patron::Messages; |
1 |
package Koha::Patron::Messages; |
3 |
|
2 |
|
4 |
# This file is part of Koha. |
3 |
# This file is part of Koha. |
Lines 51-63
sub object_class {
Link Here
|
51 |
return 'Koha::Patron::Message'; |
50 |
return 'Koha::Patron::Message'; |
52 |
} |
51 |
} |
53 |
|
52 |
|
54 |
=head3 unread |
53 |
=head3 filter_by_unread |
55 |
|
54 |
|
56 |
Returns a result set of messages that haven't been marked read by the patron |
55 |
Returns a result set of messages that haven't been marked read by the patron |
57 |
|
56 |
|
58 |
=cut |
57 |
=cut |
59 |
|
58 |
|
60 |
sub unread { |
59 |
sub filter_by_unread { |
61 |
# return resultset of messages with an undefined patron_read_date |
60 |
# return resultset of messages with an undefined patron_read_date |
62 |
my ($self, $params) = @_; |
61 |
my ($self, $params) = @_; |
63 |
$params ||= {}; |
62 |
$params ||= {}; |
Lines 66-83
sub unread {
Link Here
|
66 |
%$params, |
65 |
%$params, |
67 |
}); |
66 |
}); |
68 |
} |
67 |
} |
69 |
|
|
|
70 |
=head3 unread_count |
71 |
|
72 |
Returns a count of messages that haven't been marked read by the patron |
73 |
|
74 |
=cut |
75 |
|
76 |
|
77 |
sub unread_count { |
78 |
# return count of unread |
79 |
my ($self, $params) = @_; |
80 |
$params ||= {}; |
81 |
return $self->unread(%$params)->count(); |
82 |
} |
83 |
1; |
68 |
1; |