Bugzilla – Attachment 10476 Details for
Bug 8309
Koha namespace organisation, first implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Branchrelation package, 1st draft
Branchrelation-package-1st-draft.patch (text/plain), 2.52 KB, created by
Paul Poulain
on 2012-06-25 13:05:43 UTC
(
hide
)
Description:
Branchrelation package, 1st draft
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-06-25 13:05:43 UTC
Size:
2.52 KB
patch
obsolete
>From 724151b575e0b32c3e3ca7fee95d2f89bf8e8884 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 20 Jun 2012 09:08:59 +0200 >Subject: [PATCH] Branchrelation package, 1st draft > >unused in my tests I think, commiting it just in case > >http://bugs.koha-community.org/show_bug.cgi?id=8309 >--- > Koha/BusinessLogic/Branchrelation.pm | 5 +++++ > Koha/DB/Branchrelation.pm | 40 ++++++++++++++++++++++++++++++++++ > Koha/DataObject/Branchrelation.pm | 5 +++++ > 3 files changed, 50 insertions(+) > create mode 100644 Koha/BusinessLogic/Branchrelation.pm > create mode 100644 Koha/DB/Branchrelation.pm > create mode 100644 Koha/DataObject/Branchrelation.pm > >diff --git a/Koha/BusinessLogic/Branchrelation.pm b/Koha/BusinessLogic/Branchrelation.pm >new file mode 100644 >index 0000000..25560cb >--- /dev/null >+++ b/Koha/BusinessLogic/Branchrelation.pm >@@ -0,0 +1,5 @@ >+package Koha::BusinessLogic::Branchrelation; >+ >+use Modern::Perl; >+use Moose; >+extends (qw(Koha::DataObject::Branchrelation)); >diff --git a/Koha/DB/Branchrelation.pm b/Koha/DB/Branchrelation.pm >new file mode 100644 >index 0000000..e513f16 >--- /dev/null >+++ b/Koha/DB/Branchrelation.pm >@@ -0,0 +1,40 @@ >+package Koha::DB::Branchrelation; >+ >+use Modern::Perl; >+use C4::Context; #FIXME = create a Koha package for KOHA_CONF reading >+ >+use Koha::Schema; >+ >+use Moose; >+ >+has 'branchcode' => (is => 'rw', required => 0, isa => 'Str'); >+has 'categorycode' => (is => 'rw', required => 0, isa => 'Str'); >+ >+ >+my $schema = Koha::Schema->connect( >+ 'dbi:mysql:dbname='.C4::Context->config("database"), >+ C4::Context->config("user"), >+ C4::Context->config("pass"), >+ { AutoCommit => 1 }, >+ ); >+ >+sub create { >+ my ($self) = @_; >+ $schema->resultset('Branchrelation')->create({%{$self}}); >+} >+ >+sub read { >+ my ($self, $branchrelation) = @_; >+ return $schema->resultset('Branchrelation')->search($branchrelation); >+} >+ >+sub update { >+ my ($self, $branchrelation) = @_; >+ return $schema->resultset('Branchrelation')->search({branchcode => $branchrelation->{branchcode}})->update($branchrelation); >+} >+ >+sub delete { >+ my ($self,$branchrelation) = @_; >+ $schema->resultset('Branchrelation')->search($branchrelation)->delete; >+} >+ >diff --git a/Koha/DataObject/Branchrelation.pm b/Koha/DataObject/Branchrelation.pm >new file mode 100644 >index 0000000..dda0768 >--- /dev/null >+++ b/Koha/DataObject/Branchrelation.pm >@@ -0,0 +1,5 @@ >+package Koha::DataObject::Branchrelation; >+ >+use Modern::Perl; >+use Moose; >+extends (qw(Koha::DB::Branchrelation)); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8309
:
10473
|
10474
|
10475
| 10476 |
10477
|
10478