enable CardFortress in test database, #71513
[freeside.git] / FS / FS / part_pkg_currency.pm
1 package FS::part_pkg_currency;
2 use base qw( FS::Record );
3
4 use strict;
5
6 =head1 NAME
7
8 FS::part_pkg_currency - Object methods for part_pkg_currency records
9
10 =head1 SYNOPSIS
11
12   use FS::part_pkg_currency;
13
14   $record = new FS::part_pkg_currency \%hash;
15   $record = new FS::part_pkg_currency { 'column' => 'value' };
16
17   $error = $record->insert;
18
19   $error = $new_record->replace($old_record);
20
21   $error = $record->delete;
22
23   $error = $record->check;
24
25 =head1 DESCRIPTION
26
27 An FS::part_pkg_currency object represents an example.  FS::part_pkg_currency inherits from
28 FS::Record.  The following fields are currently supported:
29
30 =over 4
31
32 =item pkgcurrencynum
33
34 primary key
35
36 =item pkgpart
37
38 Package definition (see L<FS::part_pkg>).
39
40 =item currency
41
42 3-letter currency code
43
44 =item optionname
45
46 optionname
47
48 =item optionvalue
49
50 optionvalue
51
52
53 =back
54
55 =head1 METHODS
56
57 =over 4
58
59 =item new HASHREF
60
61 Creates a new example.  To add the example to the database, see L<"insert">.
62
63 Note that this stores the hash reference, not a distinct copy of the hash it
64 points to.  You can ask the object for a copy with the I<hash> method.
65
66 =cut
67
68 # the new method can be inherited from FS::Record, if a table method is defined
69
70 sub table { 'part_pkg_currency'; }
71
72 =item insert
73
74 Adds this record to the database.  If there is an error, returns the error,
75 otherwise returns false.
76
77 =cut
78
79 # the insert method can be inherited from FS::Record
80
81 =item delete
82
83 Delete this record from the database.
84
85 =cut
86
87 # the delete method can be inherited from FS::Record
88
89 =item replace OLD_RECORD
90
91 Replaces the OLD_RECORD with this one in the database.  If there is an error,
92 returns the error, otherwise returns false.
93
94 =cut
95
96 # the replace method can be inherited from FS::Record
97
98 =item check
99
100 Checks all fields to make sure this is a valid example.  If there is
101 an error, returns the error, otherwise returns false.  Called by the insert
102 and replace methods.
103
104 =cut
105
106 # the check method should currently be supplied - FS::Record contains some
107 # data checking routines
108
109 sub check {
110   my $self = shift;
111
112   my $error = 
113     $self->ut_numbern('pkgcurrencynum')
114     || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
115     || $self->ut_currency('currency')
116     || $self->ut_text('optionname')
117     || $self->ut_textn('optionvalue')
118   ;
119   return $error if $error;
120
121   $self->SUPER::check;
122 }
123
124 =back
125
126 =head1 BUGS
127
128 The author forgot to customize this manpage.
129
130 =head1 SEE ALSO
131
132 L<FS::Record>, schema.html from the base documentation.
133
134 =cut
135
136 1;
137