5e755ef732573309270e9821837e6faf57a7aaf3
[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 =item loc - rest of number
46
47 =back
48
49 =head1 METHODS
50
51 =over 4
52
53 =item new HASHREF
54
55 Creates a new point of presence (if only it were that easy!).  To add the 
56 point of presence to the database, see L<"insert">.
57
58 =cut
59
60 sub table { 'svc_acct_pop'; }
61
62 =item insert
63
64 Adds this point of presence to the database.  If there is an error, returns the
65 error, otherwise returns false.
66
67 =item delete
68
69 Removes this point of presence from the database.
70
71 =item replace OLD_RECORD
72
73 Replaces OLD_RECORD with this one in the database.  If there is an error,
74 returns the error, otherwise returns false.
75
76 =item check
77
78 Checks all fields to make sure this is a valid point of presence.  If there is
79 an error, returns the error, otherwise returns false.  Called by the insert
80 and replace methods.
81
82 =cut
83
84 sub check {
85   my $self = shift;
86
87     $self->ut_numbern('popnum')
88       or $self->ut_text('city')
89       or $self->ut_text('state')
90       or $self->ut_number('ac')
91       or $self->ut_number('exch')
92       or $self->ut_numbern('loc')
93   ;
94
95 }
96
97 =back
98
99 =head1 VERSION
100
101 $Id: svc_acct_pop.pm,v 1.2 2000-01-28 22:55:06 ivan Exp $
102
103 =head1 BUGS
104
105 It should be renamed to part_pop.
106
107 =head1 SEE ALSO
108
109 L<FS::Record>, L<svc_acct>, schema.html from the base documentation.
110
111 =cut
112
113 1;
114