initial checkin of module files for proper perl installation
[freeside.git] / FS / FS / svc_acct_pop.pm
1 package FS::svc_acct_pop;
2
3 use strict;
4 use vars qw( @ISA );
5 use FS::Record qw( qsearchs );
6
7 @ISA = qw( FS::Record );
8
9 =head1 NAME
10
11 FS::svc_acct_pop - Object methods for svc_acct_pop records
12
13 =head1 SYNOPSIS
14
15   use FS::svc_acct_pop;
16
17   $record = new FS::svc_acct_pop \%hash;
18   $record = new FS::svc_acct_pop { 'column' => 'value' };
19
20   $error = $record->insert;
21
22   $error = $new_record->replace($old_record);
23
24   $error = $record->delete;
25
26   $error = $record->check;
27
28 =head1 DESCRIPTION
29
30 An FS::svc_acct object represents an point of presence.  FS::svc_acct_pop
31 inherits from FS::Record.  The following fields are currently supported:
32
33 =over 4
34
35 =item popnum - primary key (assigned automatically for new accounts)
36
37 =item city
38
39 =item state
40
41 =item ac - area code
42
43 =item exch - exchange
44
45 =back
46
47 =head1 METHODS
48
49 =over 4
50
51 =item new HASHREF
52
53 Creates a new point of presence (if only it were that easy!).  To add the 
54 point of presence to the database, see L<"insert">.
55
56 =cut
57
58 sub table { 'svc_acct_pop'; }
59
60 =item insert
61
62 Adds this point of presence to the database.  If there is an error, returns the
63 error, otherwise returns false.
64
65 =item delete
66
67 Removes this point of presence from the database.
68
69 =item replace OLD_RECORD
70
71 Replaces OLD_RECORD with this one in the database.  If there is an error,
72 returns the error, otherwise returns false.
73
74 =item check
75
76 Checks all fields to make sure this is a valid point of presence.  If there is
77 an error, returns the error, otherwise returns false.  Called by the insert
78 and replace methods.
79
80 =cut
81
82 sub check {
83   my $self = shift;
84
85     $self->ut_numbern('popnum')
86       or $self->ut_text('city')
87       or $self->ut_text('state')
88       or $self->ut_number('ac')
89       or $self->ut_number('exch')
90   ;
91
92 }
93
94 =back
95
96 =head1 VERSION
97
98 $Id: svc_acct_pop.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
99
100 =head1 BUGS
101
102 It should be renamed to part_pop.
103
104 =head1 SEE ALSO
105
106 L<FS::Record>, L<svc_acct>, schema.html from the base documentation.
107
108 =cut
109
110 1;
111