<<

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 };

type

    my $attribute_type = $attribute->type;

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

authorised_value

my $authorised_value = $attribute->authorised_value;

Return the Koha::AuthorisedValue object of this attribute when one is attached.

Return undef if this attribute is not attached to an authorised value

description

my $description = $patron_attribute->description;

Return the value of this attribute or the description of the authorised value (when attached).

This method must be called when the authorised value's description must be displayed instead of the code.

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

<<