View | Details | Raw Unified | Return to bug 35906
Collapse All | Expand All

(-)a/Koha/Item.pm (-19 lines)
Lines 1812-1835 sub itemtype { Link Here
1812
    return Koha::ItemTypes->find( $self->effective_itemtype );
1812
    return Koha::ItemTypes->find( $self->effective_itemtype );
1813
}
1813
}
1814
1814
1815
=head3 item_type
1816
1817
    my $item_type = $item->item_type;
1818
1819
Returns the effective I<Koha::ItemType> for the item.
1820
1821
FIXME: it should either return the 'real item type' or undef if no item type
1822
defined. And effective_itemtype should return... the effective itemtype. Right
1823
now it returns an id... This is all inconsistent. And the API should make it clear
1824
if the attribute is part of the resource, or a calculated value i.e. if the item
1825
is not linked to an item type on its own, then the API response should contain
1826
item_type: null! And the effective item type... be another attribute. I understand
1827
that this complicates filtering, but some query trickery could do it in the controller.
1828
1829
=cut
1830
1831
sub item_type {
1832
    return shift->itemtype;
1833
=head3 effective_bookable
1815
=head3 effective_bookable
1834
1816
1835
  my $bookable = $item->effective_bookable;
1817
  my $bookable = $item->effective_bookable;
1836
- 

Return to bug 35906