Line 0
Link Here
|
|
|
1 |
package Koha::Edifact::File::Error; |
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it |
6 |
# under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 3 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but |
11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
18 |
use Modern::Perl; |
19 |
|
20 |
use base qw(Koha::Object); |
21 |
|
22 |
=encoding utf8 |
23 |
|
24 |
=head1 Name |
25 |
|
26 |
Koha::Edifact::File::Error - Koha::Object class for single EDIFACT file |
27 |
|
28 |
=head2 Class methods |
29 |
|
30 |
=head3 file |
31 |
|
32 |
my $file = $error->file; |
33 |
|
34 |
Returns the I<Koha::Edifact::File> associated with this error |
35 |
|
36 |
=cut |
37 |
|
38 |
sub file { |
39 |
my ($self) = @_; |
40 |
my $file_rs = $self->_result->message; |
41 |
return unless $file_rs; |
42 |
return Koha::Edifact::File->_new_from_dbic($file_rs); |
43 |
} |
44 |
|
45 |
=head3 to_api_mapping |
46 |
|
47 |
This method returns the mapping for representing a Koha::Edifact::File::Error object |
48 |
on the API. |
49 |
|
50 |
=cut |
51 |
|
52 |
sub to_api_mapping { |
53 |
return { |
54 |
message_id => 'file_id', |
55 |
}; |
56 |
} |
57 |
|
58 |
=head2 Internal methods |
59 |
|
60 |
=head3 _type |
61 |
|
62 |
Returns name of corresponding DBIC resultset |
63 |
|
64 |
=cut |
65 |
|
66 |
sub _type { |
67 |
return 'EdifactError'; |
68 |
} |
69 |
|
70 |
=head1 AUTHOR |
71 |
|
72 |
Martin Renvoize <martin.renvoize@ptfs-europe.com> |
73 |
|
74 |
Koha Development Team |
75 |
|
76 |
=cut |
77 |
|
78 |
1; |