<<

NAME

Koha::Patron::Attribute - Koha Patron Attribute Object class

API

Class Methods

store

    my $attribute = Koha::Patron::Attribute->new({ code => 'a_code', ... });
    try { $attribute->store }
    catch { handle_exception };

opac_display

    my $attribute = Koha::Patron::Attribute->new({ code => 'a_code', ... });
    if ( $attribute->opac_display ) { ... }

opac_editable

    my $attribute = Koha::Patron::Attribute->new({ code => 'a_code', ... });
    if ( $attribute->is_opac_editable ) { ... }

display_checkout

    my $attribute = Koha::Patron::Attribute->new({ code => 'a_code', ... });
    if ( $attribute->display_checkout ) { ... }

value_description

    my $description = $attribute->value_description

    Return authorised value description or free text based on attribute type settings

type_description

    my $description = $attribute->type_description

    Return description of attribute type

type

    my $attribute_type = $attribute->type;

Returns a Koha::Patron::Attribute::Type object corresponding to the current patron attribute

Internal methods

_check_repeatable

_check_repeatable checks if the attribute type is repeatable and throws and exception if the attribute type isn't repeatable and there's already an attribute with the same code for the given patron.

_check_unique_id

_check_unique_id checks if the attribute type is marked as unique id and throws and exception if the attribute type is a unique id and there's already an attribute with the same code and value on the database.

_type

<<