delete fees, RT#81713
[freeside.git] / FS / FS / registrar.pm
1 package FS::registrar;
2 use base qw(FS::Record);
3
4 use strict;
5
6 =head1 NAME
7
8 FS::registrar - Object methods for registrar records
9
10 =head1 SYNOPSIS
11
12   use FS::registrar;
13
14   $record = new FS::registrar \%hash;
15   $record = new FS::registrar { '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::registrar object represents a registrar.  FS::registrar inherits from
28 FS::Record.  The following fields are currently supported:
29
30 =over 4
31
32 =item registrarnum - primary key
33
34 =item registrarname - 
35
36
37 =back
38
39 =head1 METHODS
40
41 =over 4
42
43 =item new HASHREF
44
45 Creates a new registrar.  To add the registrar to the database, see L<"insert">.
46
47 Note that this stores the hash reference, not a distinct copy of the hash it
48 points to.  You can ask the object for a copy with the I<hash> method.
49
50 =cut
51
52 # the new method can be inherited from FS::Record, if a table method is defined
53
54 sub table { 'registrar'; }
55
56 =item insert
57
58 Adds this record to the database.  If there is an error, returns the error,
59 otherwise returns false.
60
61 =cut
62
63 # the insert method can be inherited from FS::Record
64
65 =item delete
66
67 Delete this record from the database.
68
69 =cut
70
71 # the delete method can be inherited from FS::Record
72
73 =item replace OLD_RECORD
74
75 Replaces the OLD_RECORD with this one in the database.  If there is an error,
76 returns the error, otherwise returns false.
77
78 =cut
79
80 # the replace method can be inherited from FS::Record
81
82 =item check
83
84 Checks all fields to make sure this is a valid registrar.  If there is
85 an error, returns the error, otherwise returns false.  Called by the insert
86 and replace methods.
87
88 =cut
89
90 # the check method should currently be supplied - FS::Record contains some
91 # data checking routines
92
93 sub check {
94   my $self = shift;
95
96   my $error = 
97     $self->ut_numbern('registrarnum')
98     || $self->ut_text('registrarname')
99   ;
100   return $error if $error;
101
102   $self->SUPER::check;
103 }
104
105 =back
106
107 =head1 BUGS
108
109 =head1 SEE ALSO
110
111 L<FS::Record>, schema.html from the base documentation.
112
113 =cut
114
115 1;
116