<<

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.

to_api_mapping

This method returns the mapping for representing a Koha::Patron::Attribute object on the API.

repeatable_ok

Checks if the attribute type is repeatable and returns a boolean representing whether storing the current object state would break the repeatable constraint.

unique_ok

Checks if the attribute type is marked as unique and returns a boolean representing whether storing the current object state would break the unique constraint.

value_ok

Checks if the value of the attribute is valid for the type

Internal methods

_type

<<