Koha::Patron::Attribute - Koha Patron Attribute Object class
my $attribute = Koha::Patron::Attribute->new({ code => 'a_code', ... }); try { $attribute->store } catch { handle_exception };
my $attribute_type = $attribute->type;
Returns a Koha::Patron::Attribute::Type
object corresponding to the current patron attribute
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
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.
_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 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.