From ce7f24346bdcb14c579b4ac6273b5213b373d28f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 12 May 2022 18:23:27 +0200 Subject: [PATCH] Bug 32030: ERM - related agreement koha classes Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- Koha/ERM/Agreement/Relationship.pm | 58 +++++++++++++++++++++++++++++ Koha/ERM/Agreement/Relationships.pm | 49 ++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 Koha/ERM/Agreement/Relationship.pm create mode 100644 Koha/ERM/Agreement/Relationships.pm diff --git a/Koha/ERM/Agreement/Relationship.pm b/Koha/ERM/Agreement/Relationship.pm new file mode 100644 index 0000000000..eac0b28325 --- /dev/null +++ b/Koha/ERM/Agreement/Relationship.pm @@ -0,0 +1,58 @@ +package Koha::ERM::Agreement::Relationship; + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use Koha::Patrons; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::ERM::Agreement::Relationship - Koha Agreement Relationship Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 agreement + +Return the agreement linked to this relationship + +=cut + +sub agreement { + my ( $self ) = @_; + my $agreement_rs = $self->_result->agreement; + return Koha::ERM::Agreement->_new_from_dbic($agreement_rs); +} + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'ErmAgreementRelationship'; +} + +1; diff --git a/Koha/ERM/Agreement/Relationships.pm b/Koha/ERM/Agreement/Relationships.pm new file mode 100644 index 0000000000..ae501723d7 --- /dev/null +++ b/Koha/ERM/Agreement/Relationships.pm @@ -0,0 +1,49 @@ +package Koha::ERM::Agreement::RelatedAgreements; + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + + +use Koha::Database; + +use Koha::ERM::Agreement::RelatedAgreement; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::ERM::Agreement::RelatedAgreements- Koha Agreement RelatedAgreement Object set class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'ErmAgreementRelationship'; +} + +sub object_class { + return 'Koha::ERM::Agreement::RelatedAgreement'; +} + +1; -- 2.20.1