Bug 32030: ERM - related agreement koha classes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 May 2022 16:23:27 +0000 (18:23 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 8 Nov 2022 12:43:50 +0000 (09:43 -0300)
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/ERM/Agreement/Relationship.pm [new file with mode: 0644]
Koha/ERM/Agreement/Relationships.pm [new file with mode: 0644]

diff --git a/Koha/ERM/Agreement/Relationship.pm b/Koha/ERM/Agreement/Relationship.pm
new file mode 100644 (file)
index 0000000..eac0b28
--- /dev/null
@@ -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 <http://www.gnu.org/licenses>.
+
+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 (file)
index 0000000..ae50172
--- /dev/null
@@ -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 <http://www.gnu.org/licenses>.
+
+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;