There is no need to define biblioitem routines, if we can access them
via biblioitemnumber.
Note that we actually need a FK for biblio in the items table. Now we do
need the intermediate level via biblioitems in the Items.t code. Even better,
we should move biblioitem to biblio. Formally it is 1-n, but in reality it
is 1-1.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0//8OGf7OteNnwT03g4QsA
-sub biblioitem {
- my ( $self ) = @_;
- my @biblioitems = $self->biblioitems;
- return $biblioitems[0];
-}
-
1;
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-24 09:58:16
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2slVK/FjcRDiYLeufoOFQQ
-sub biblioitem {
- my ( $self ) = @_;
- my @biblioitems = $self->biblioitemnumber;
- return $biblioitems[0];
-}
-
sub effective_itemtype {
my ( $self ) = @_;
if ( $pref->value() ) {
return $self->itype();
} else {
- return $self->biblioitem()->itemtype();
+ return $self->biblioitemnumber()->itemtype();
}
}
}
);
- my ( $item ) = $biblio->biblioitem->items();
+ my @bi = $biblio->biblioitems();
+ my ( $item ) = $bi[0]->items();
C4::Context->set_preference( 'item-level_itypes', 0 );
ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' );