=head3 itemtype
- my $itemtype = $item->itemtype({ effective => 1 });
+ my $itemtype = $item->itemtype;
- Returns Koha object for (effective) itemtype
+ Returns Koha object for effective itemtype
=cut
sub itemtype {
- my ( $self, $params ) = @_;
- return Koha::ItemTypes->find( $params->{effective} ? $self->effective_itemtype : $self->itype ); # no FK
+ my ( $self ) = @_;
+ return Koha::ItemTypes->find( $self->effective_itemtype );
}
=head2 Internal methods
};
subtest 'Tests for itemtype' => sub {
- plan tests => 4;
+ plan tests => 2;
$schema->storage->txn_begin;
my $biblio = $builder->build_sample_biblio;
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, itype => $itemtype->itemtype });
t::lib::Mocks::mock_preference('item-level_itypes', 1);
- is( $item->itemtype({ effective => 1 })->itemtype, $item->itype, 'Pref enabled, effective parameter' );
- is( $item->itemtype->itemtype, $item->itype, 'Pref enabled, no parameter' );
+ is( $item->itemtype->itemtype, $item->itype, 'Pref enabled' );
t::lib::Mocks::mock_preference('item-level_itypes', 0);
- is( $item->itemtype({ effective => 1 })->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled, effective parameter' );
- is( $item->itemtype->itemtype, $item->itype, 'Pref disabled, no parameter' );
+ is( $item->itemtype->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled' );
$schema->storage->txn_rollback;
};