use Carp;
+use C4::Biblio qw( GetRecordValue GetMarcBiblio GetFrameworkCode );
+
use Koha::Database;
use base qw(Koha::Object);
=cut
+=head3 subtitles
+
+my @subtitles = $biblio->subtitles();
+
+Returns list of subtitles for a record.
+
+Keyword to MARC mapping for subtitle must be set for this method to return any possible values.
+
+=cut
+
+sub subtitles {
+ my ( $self ) = @_;
+
+ return map { $_->{subfield} } @{ GetRecordValue( 'subtitle', GetMarcBiblio( $self->id ), $self->frameworkcode ) };
+}
+
+=head3 items
+
+Returns the related Koha::Items object for this biblio in scalar context,
+or list of Koha::Item objects in list context.
+
+=cut
+
+sub items {
+ my ($self) = @_;
+
+ $self->{_items} ||= Koha::Items->search( { biblionumber => $self->biblionumber() } );
+
+ return wantarray ? $self->{_items}->as_list : $self->{_items};
+}
+
=head3 type
=cut
-sub type {
+sub _type {
return 'Biblio';
}