C4::Members::AttributeTypes - mananage extended patron attribute types
my @attribute_types = C4::Members::AttributeTypes::GetAttributeTypes(); my $attr_type = C4::Members::AttributeTypes->new($code, $description); $attr_type->code($code); $attr_type->description($description); $attr_type->repeatable($repeatable); $attr_type->unique_id($unique_id); $attr_type->opac_display($opac_display); $attr_type->opac_editable($opac_editable); $attr_type->staff_searchable($staff_searchable); $attr_type->authorised_value_category($authorised_value_category); $attr_type->store(); $attr_type->delete(); my $attr_type = C4::Members::AttributeTypes->fetch($code); $attr_type = C4::Members::AttributeTypes->delete($code);
my @attribute_types = C4::Members::AttributeTypes::GetAttributeTypes($all_fields);
Returns an array of hashrefs of each attribute type defined in the database. The array is sorted by code. Each hashref contains at least the following fields:
- code - description
If $all_fields is true, then each hashref also contains the other fields from borrower_attribute_types.
my $attr_type = C4::Members::AttributeTypes->new($code, $description);
Create a new attribute type.
my $attr_type = C4::Members::AttributeTypes->fetch($code);
Fetches an attribute type from the database. If no type with the given $code
exists, returns undef.
$attr_type->store();
Stores attribute type in the database. If the type previously retrieved from the database via the fetch() method, the DB representation of the type is replaced.
my $code = $attr_type->code(); $attr_type->code($code);
Accessor. Note that the code is immutable once a type is created or fetched from the database.
my $description = $attr_type->description(); $attr_type->description($description);
Accessor.
my $branches = $attr_type->branches(); $attr_type->branches($branches);
Accessor.
my $repeatable = $attr_type->repeatable(); $attr_type->repeatable($repeatable);
Accessor. The $repeatable
argument is interpreted as a Perl boolean.
my $unique_id = $attr_type->unique_id(); $attr_type->unique_id($unique_id);
Accessor. The $unique_id
argument is interpreted as a Perl boolean.
my $opac_display = $attr_type->opac_display(); $attr_type->opac_display($opac_display);
Accessor. The $opac_display
argument is interpreted as a Perl boolean.
my $opac_editable = $attr_type->opac_editable(); $attr_type->opac_editable($opac_editable);
Accessor. The $opac_editable
argument is interpreted as a Perl boolean.
my $staff_searchable = $attr_type->staff_searchable(); $attr_type->staff_searchable($staff_searchable);
Accessor. The $staff_searchable
argument is interpreted as a Perl boolean.
my $display_checkout = $attr_type->display_checkout(); $attr_type->display_checkout($display_checkout);
Accessor. The $display_checkout
argument is interpreted as a Perl boolean.
my $authorised_value_category = $attr_type->authorised_value_category(); $attr_type->authorised_value_category($authorised_value_category);
Accessor.
my $category_code = $attr_type->category_code(); $attr_type->category_code($category_code);
Accessor.
my $category_description = $attr_type->category_description(); $attr_type->category_description($category_description);
Accessor.
my $class = $attr_type->class(); $attr_type->class($class);
Accessor.
$attr_type->delete(); C4::Members::AttributeTypes->delete($code);
Delete an attribute type from the database. The attribute type may be specified either by an object or by a code.
my $count = $attr_type->num_patrons();
Returns the number of patron records that use this attribute type.
my @borrowernumbers = $attr_type->get_patrons($attribute);
Returns the borrowernumber of the patron records that have an attribute with the specifie value.
Koha Development Team <http://koha-community.org/>
Galen Charlton <galen.charlton@liblime.com>