use Koha::Database;
use Koha::Email;
use Koha::Exceptions::Ill;
+use Koha::Illcomments;
use Koha::Illrequestattributes;
use Koha::Patron;
);
}
+=head3 illcomments
+
+=cut
+
+sub illcomments {
+ my ( $self ) = @_;
+ return Koha::Illcomments->_new_from_dbic(
+ scalar $self->_result->illcomments
+ );
+}
+
=head3 patron
=cut
|| ""; # "the empty prefix"
}
+=head3 get_type
+
+ my $type = $abstract->get_type();
+
+Return a string representing the material type of this request or undef
+
+=cut
+
+sub get_type {
+ my ($self) = @_;
+ my $attr = $self->illrequestattributes->find({ type => 'type'});
+ return if !$attr;
+ return $attr->value;
+};
+
#### Illrequests Imports
=head3 check_limits
$self->branchcode
)->TO_JSON;
}
+ # Augment the request response with the number of comments if appropriate
+ if ( $embed->{comments} ) {
+ $object->{comments} = $self->illcomments->count;
+ }
}
return $object;