add stack backtrace to fatal problems in virtual field check
[freeside.git] / FS / FS / part_pop_local.pm
1 package FS::part_pop_local;
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::part_pop_local - Object methods for part_pop_local records
12
13 =head1 SYNOPSIS
14
15   use FS::part_pop_local;
16
17   $record = new FS::part_pop_local \%hash;
18   $record = new FS::part_pop_local { '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::part_pop_local object represents a local call area.  Each
31 FS::part_pop_local record maps a NPA/NXX (area code and exchange) to the POP
32 (see L<FS::svc_acct_pop>) which is a local call.  FS::part_pop_local inherits
33 from FS::Record.  The following fields are currently supported:
34
35 =over 4
36
37 =item localnum - primary key (assigned automatically for new accounts)
38
39 =item popnum - see L<FS::svc_acct_pop>
40
41 =item city
42
43 =item state
44
45 =item npa - area code
46
47 =item nxx - exchange
48
49 =back
50
51 =head1 METHODS
52
53 =over 4
54
55 =item new HASHREF
56
57 Creates a new point of presence (if only it were that easy!).  To add the 
58 point of presence to the database, see L<"insert">.
59
60 =cut
61
62 sub table { 'part_pop_local'; }
63
64 =item insert
65
66 Adds this point of presence to the database.  If there is an error, returns the
67 error, otherwise returns false.
68
69 =item delete
70
71 Removes this point of presence from the database.
72
73 =item replace OLD_RECORD
74
75 Replaces OLD_RECORD with this one in the database.  If there is an error,
76 returns the error, otherwise returns false.
77
78 =item check
79
80 Checks all fields to make sure this is a valid point of presence.  If there is
81 an error, returns the error, otherwise returns false.  Called by the insert
82 and replace methods.
83
84 =cut
85
86 sub check {
87   my $self = shift;
88
89     $self->ut_numbern('localnum')
90       or $self->ut_numbern('popnum')
91       or $self->ut_text('city')
92       or $self->ut_text('state')
93       or $self->ut_number('npa')
94       or $self->ut_number('nxx')
95       or $self->SUPER::check
96   ;
97
98 }
99
100 =back
101
102 =head1 VERSION
103
104 $Id: part_pop_local.pm,v 1.2 2003-08-05 00:20:44 khoff Exp $
105
106 =head1 BUGS
107
108 US/CA-centric.
109
110 =head1 SEE ALSO
111
112 L<FS::Record>, L<FS::svc_acct_pop>, schema.html from the base documentation.
113
114 =cut
115
116 1;
117