<<

NAME

C4::Members::AttributeTypes - mananage extended patron attribute types

SYNOPSIS

  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->password_allowed($password_allowed);
  $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);

FUNCTIONS

GetAttributeTypes

  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.

METHODS

  my $attr_type = C4::Members::AttributeTypes->new($code, $description);

Create a new attribute type.

fetch

  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.

store

  $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.

code

  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.

description

  my $description = $attr_type->description();
  $attr_type->description($description);

Accessor.

repeatable

  my $repeatable = $attr_type->repeatable();
  $attr_type->repeatable($repeatable);

Accessor. The $repeatable argument is interpreted as a Perl boolean.

unique_id

  my $unique_id = $attr_type->unique_id();
  $attr_type->unique_id($unique_id);

Accessor. The $unique_id argument is interpreted as a Perl boolean.

opac_display

  my $opac_display = $attr_type->opac_display();
  $attr_type->opac_display($opac_display);

Accessor. The $opac_display argument is interpreted as a Perl boolean.

password_allowed

  my $password_allowed = $attr_type->password_allowed();
  $attr_type->password_allowed($password_allowed);

Accessor. The $password_allowed argument is interpreted as a Perl boolean.

staff_searchable

  my $staff_searchable = $attr_type->staff_searchable();
  $attr_type->staff_searchable($staff_searchable);

Accessor. The $staff_searchable argument is interpreted as a Perl boolean.

authorised_value_category

  my $authorised_value_category = $attr_type->authorised_value_category();
  $attr_type->authorised_value_category($authorised_value_category);

Accessor.

delete

  $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.

num_patrons

  my $count = $attr_type->num_patrons();

Returns the number of patron records that use this attribute type.

get_patrons

  my @borrowernumbers = $attr_type->get_patrons($attribute);

Returns the borrowernumber of the patron records that have an attribute with the specifie value.

AUTHOR

Koha Development Team <http://koha-community.org/>

Galen Charlton <galen.charlton@liblime.com>

<<
https://perldoc.koha-community.org/v3.02.04/C4/Members/AttributeTypes.html
perldoc.koha-community.org
crawl=CC-MAIN-2022-40
9149
application/http; msgtype=response
sha1:FWSYUKKKTXSP6KF3PKLCT2ISH4564AV7
<urn:uuid:68b00559-f905-4641-9cfc-fe5034f0b313>
2022-10-07T03:02:34Z
67.220.127.145
text/html
sha1:RTLE674UFEHGKF4FYSYYP4K4AKUZ3T6B
<urn:uuid:2e07b9f3-cf08-411e-92c6-dd5337465754>
https://perldoc.koha-community.org/v3.02.04/C4/Members/AttributeTypes.html
response
<urn:uuid:3eef45b6-a06f-4c04-b9df-ae313fd0dfb2>
isPartOf: CC-MAIN-2022-40
publisher: Common Crawl
description: Wide crawl of the web for September/October 2022
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-120
software: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/