From b0ac454669e0b841da1ff2b4e998590a64160ff7 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Wed, 29 Jul 2015 15:16:34 +0300 Subject: [PATCH] Bug 14616 - Introducing Koha::Object subclasses Just adding the working subclasses as a convenience. --- Koha/Biblio.pm | 32 ++++++++++++++++++++++++++++++++ Koha/BiblioItem.pm | 32 ++++++++++++++++++++++++++++++++ Koha/BiblioItems.pm | 38 ++++++++++++++++++++++++++++++++++++++ Koha/Biblios.pm | 38 ++++++++++++++++++++++++++++++++++++++ Koha/Checkout.pm | 32 ++++++++++++++++++++++++++++++++ Koha/Checkouts.pm | 38 ++++++++++++++++++++++++++++++++++++++ Koha/Item.pm | 32 ++++++++++++++++++++++++++++++++ Koha/Items.pm | 42 ++++++++++++++++++++++++++++++++++++++++++ Koha/LetterTemplate.pm | 32 ++++++++++++++++++++++++++++++++ Koha/LetterTemplates.pm | 38 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 354 insertions(+) create mode 100644 Koha/Biblio.pm create mode 100644 Koha/BiblioItem.pm create mode 100644 Koha/BiblioItems.pm create mode 100644 Koha/Biblios.pm create mode 100644 Koha/Checkout.pm create mode 100644 Koha/Checkouts.pm create mode 100644 Koha/Item.pm create mode 100644 Koha/Items.pm create mode 100644 Koha/LetterTemplate.pm create mode 100644 Koha/LetterTemplates.pm diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm new file mode 100644 index 0000000..4ad9613 --- /dev/null +++ b/Koha/Biblio.pm @@ -0,0 +1,32 @@ +package Koha::Biblio; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +sub type { + return 'Biblio'; +} + +1; diff --git a/Koha/BiblioItem.pm b/Koha/BiblioItem.pm new file mode 100644 index 0000000..b4e172a --- /dev/null +++ b/Koha/BiblioItem.pm @@ -0,0 +1,32 @@ +package Koha::BiblioItem; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +sub type { + return 'BiblioItem'; +} + +1; diff --git a/Koha/BiblioItems.pm b/Koha/BiblioItems.pm new file mode 100644 index 0000000..0769f73 --- /dev/null +++ b/Koha/BiblioItems.pm @@ -0,0 +1,38 @@ +package Koha::BiblioItems; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::BiblioItem; + +use base qw(Koha::Objects); + +sub type { + return 'BiblioItem'; +} + +sub object_class { + return 'Koha::BiblioItem'; +} + +1; diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm new file mode 100644 index 0000000..82dcf41 --- /dev/null +++ b/Koha/Biblios.pm @@ -0,0 +1,38 @@ +package Koha::Biblios; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Biblio; + +use base qw(Koha::Objects); + +sub type { + return 'Biblio'; +} + +sub object_class { + return 'Koha::Biblio'; +} + +1; diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm new file mode 100644 index 0000000..1cbd76b --- /dev/null +++ b/Koha/Checkout.pm @@ -0,0 +1,32 @@ +package Koha::Checkout; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +sub type { + return 'Issue'; +} + +1; diff --git a/Koha/Checkouts.pm b/Koha/Checkouts.pm new file mode 100644 index 0000000..fe758f2 --- /dev/null +++ b/Koha/Checkouts.pm @@ -0,0 +1,38 @@ +package Koha::Checkouts; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Checkout; + +use base qw(Koha::Objects); + +sub type { + return 'Issue'; +} + +sub object_class { + return 'Koha::Checkout'; +} + +1; diff --git a/Koha/Item.pm b/Koha/Item.pm new file mode 100644 index 0000000..7e6a74b --- /dev/null +++ b/Koha/Item.pm @@ -0,0 +1,32 @@ +package Koha::Item; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +sub type { + return 'Item'; +} + +1; diff --git a/Koha/Items.pm b/Koha/Items.pm new file mode 100644 index 0000000..9231fc2 --- /dev/null +++ b/Koha/Items.pm @@ -0,0 +1,42 @@ +package Koha::Items; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Item; + +use base qw(Koha::Objects); + +sub type { + return 'Item'; +} + +sub object_class { + return 'Koha::Item'; +} + +sub _get_castable_unique_columns { + return ['itemnumber', 'barcode']; +} + +1; diff --git a/Koha/LetterTemplate.pm b/Koha/LetterTemplate.pm new file mode 100644 index 0000000..7771c1e --- /dev/null +++ b/Koha/LetterTemplate.pm @@ -0,0 +1,32 @@ +package Koha::LetterTemplate; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +sub type { + return 'Letter'; +} + +1; diff --git a/Koha/LetterTemplates.pm b/Koha/LetterTemplates.pm new file mode 100644 index 0000000..e1c511d --- /dev/null +++ b/Koha/LetterTemplates.pm @@ -0,0 +1,38 @@ +package Koha::LetterTemplates; + +# Copyright Open Source Freedom Fighters +# +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::LetterTemplate; + +use base qw(Koha::Objects); + +sub type { + return 'Letter'; +} + +sub object_class { + return 'Koha::LetterTemplate'; +} + +1; -- 1.9.1