Bug 42310: Add Koha::Calendar::* Object classes

Four Koha::Object + Koha::Objects pairs following the Koha::City(ies)
pattern:

- Koha::Calendar::WeeklyClosure(s) -> library_weekly_closures
- Koha::Calendar::RepeatingClosure(s) -> library_repeating_closures
- Koha::Calendar::SingleClosure(s) -> library_single_closures
- Koha::Calendar::Exception(s) -> library_closure_exceptions

DBIC schema files to be generated via the 'dbic' alias in KTD
after the database migration runs.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Tomás Cohen Arazi 2026-04-08 15:32:11 -03:00 committed by Pedro Amorim
parent 5a3e86d0b6
commit 402938f7cd
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
8 changed files with 376 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package Koha::Calendar::Exception;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use base qw(Koha::Object);
=head1 NAME
Koha::Calendar::Exception - Koha closure exception (open override) Object class
=head1 API
=head2 Internal methods
=head3 _type
=cut
sub _type {
return 'LibraryClosureException';
}
1;

View File

@ -0,0 +1,52 @@
package Koha::Calendar::Exceptions;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use Koha::Calendar::Exception;
use base qw(Koha::Objects);
=head1 NAME
Koha::Calendar::Exceptions - Koha closure exception Object set class
=head1 API
=head2 Class methods
=head3 _type
=cut
sub _type {
return 'LibraryClosureException';
}
=head3 object_class
=cut
sub object_class {
return 'Koha::Calendar::Exception';
}
1;

View File

@ -0,0 +1,42 @@
package Koha::Calendar::RepeatingClosure;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use base qw(Koha::Object);
=head1 NAME
Koha::Calendar::RepeatingClosure - Koha annual repeating closure Object class
=head1 API
=head2 Internal methods
=head3 _type
=cut
sub _type {
return 'LibraryRepeatingClosure';
}
1;

View File

@ -0,0 +1,52 @@
package Koha::Calendar::RepeatingClosures;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use Koha::Calendar::RepeatingClosure;
use base qw(Koha::Objects);
=head1 NAME
Koha::Calendar::RepeatingClosures - Koha annual repeating closure Object set class
=head1 API
=head2 Class methods
=head3 _type
=cut
sub _type {
return 'LibraryRepeatingClosure';
}
=head3 object_class
=cut
sub object_class {
return 'Koha::Calendar::RepeatingClosure';
}
1;

View File

@ -0,0 +1,42 @@
package Koha::Calendar::SingleClosure;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use base qw(Koha::Object);
=head1 NAME
Koha::Calendar::SingleClosure - Koha single-date closure Object class
=head1 API
=head2 Internal methods
=head3 _type
=cut
sub _type {
return 'LibrarySingleClosure';
}
1;

View File

@ -0,0 +1,52 @@
package Koha::Calendar::SingleClosures;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use Koha::Calendar::SingleClosure;
use base qw(Koha::Objects);
=head1 NAME
Koha::Calendar::SingleClosures - Koha single-date closure Object set class
=head1 API
=head2 Class methods
=head3 _type
=cut
sub _type {
return 'LibrarySingleClosure';
}
=head3 object_class
=cut
sub object_class {
return 'Koha::Calendar::SingleClosure';
}
1;

View File

@ -0,0 +1,42 @@
package Koha::Calendar::WeeklyClosure;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use base qw(Koha::Object);
=head1 NAME
Koha::Calendar::WeeklyClosure - Koha weekly closure Object class
=head1 API
=head2 Internal methods
=head3 _type
=cut
sub _type {
return 'LibraryWeeklyClosure';
}
1;

View File

@ -0,0 +1,52 @@
package Koha::Calendar::WeeklyClosures;
# Copyright 2026 Theke Solutions
#
# 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 <https://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Database;
use Koha::Calendar::WeeklyClosure;
use base qw(Koha::Objects);
=head1 NAME
Koha::Calendar::WeeklyClosures - Koha weekly closure Object set class
=head1 API
=head2 Class methods
=head3 _type
=cut
sub _type {
return 'LibraryWeeklyClosure';
}
=head3 object_class
=cut
sub object_class {
return 'Koha::Calendar::WeeklyClosure';
}
1;