C4::ClassSources - handle classification sources in Koha
use C4::ClassSource;
This module deals with manipulating classification sources and sorting rules.
my $sources = GetClassSources(); Returns reference to hash of references to the class sources, keyed on cn_source.
my $sources = GetClassSources(); my @sources = (); foreach my $cn_source (sort keys %$sources) { my $source = $sources->{$cn_source}; push @sources, { code => $source->{'cn_source'}, description => $source->{'description'}, used => $source->{'used'}, sortrule => $source->{'class_sort_rule'} } }
AddClassSource($cn_source, $description, $used, $class_sort_rule); Adds a class_sources row.
my $hashref = GetClassSource($cn_source); Retrieves a class_sources row by cn_source.
ModClassSource($cn_source, $description, $used, $class_sort_rule); Updates a class_sources row.
DelClassSource($cn_source); Deletes class_sources row.
my $sort_rules = GetClassSortRules(); Returns reference to hash of references to the class sorting rules, keyed on class_sort_rule
my $sort_rules = GetClassSortRules(); my @sort_rules = (); foreach my $sort_rule (sort keys %$sort_rules) { my $sort_rule = $sort_rules->{$sort_rule}; push @sort_rules, { rule => $sort_rule->{'class_sort_rule'}, description => $sort_rule->{'description'}, sort_routine => $sort_rule->{'sort_routine'} } }
AddClassSortRule($class_sort_rule, $description, $sort_routine); Adds a class_sort_rules row.
my $hashref = GetClassSortRule($class_sort_rule); Retrieves a class_sort_rules row by class_sort_rule.
ModClassSortRule($class_sort_rule, $description, $sort_routine); Updates a class_sort_rules row.
DelClassSortRule($class_sort_rule); Deletes class_sort_rules row.
my @source = GetSourcesForSortRule($class_sort_rule); Retrieves an array class_source.cn_rule for each source that uses the supplied $class_sort_rule.
my $cn_sort = GetClassSort($cn_source, $cn_class, $cn_item);
Get the sort key corresponding to the classification part and item part and the defined call number source.
Koha Developement team <info@koha.org>