dcb445253f1750797d23e70a788b022515d57f6b
[freeside.git] / FS / FS / part_ac_field.pm
1 package FS::part_ac_field;
2
3 use strict;
4 use vars qw( @ISA );
5 use FS::Record qw( qsearchs );
6 use FS::ac_field;
7 use FS::ac;
8
9
10 @ISA = qw( FS::Record );
11
12 =head1 NAME
13
14 FS::part_ac_field - Object methods for part_ac_field records
15
16 =head1 SYNOPSIS
17
18   use FS::part_ac_field;
19
20   $record = new FS::part_ac_field \%hash;
21   $record = new FS::part_ac_field { 'column' => 'value' };
22
23   $error = $record->insert;
24
25   $error = $new_record->replace($old_record);
26
27   $error = $record->delete;
28
29   $error = $record->check;
30
31 =head1 DESCRIPTION
32
33
34 =over 4
35
36 =item blank
37
38 =back
39
40 =head1 METHODS
41
42 =over 4
43
44 =item new HASHREF
45
46 Create a new record.  To add the record to the database, see L<"insert">.
47
48 =cut
49
50 sub table { 'part_ac_field'; }
51
52 =item insert
53
54 Adds this record to the database.  If there is an error, returns the error,
55 otherwise returns false.
56
57 =item delete
58
59 Deletes this record from the database.  If there is an error, returns the
60 error, otherwise returns false.
61
62 =item replace OLD_RECORD
63
64 Replaces OLD_RECORD with this one in the database.  If there is an error,
65 returns the error, otherwise returns false.
66
67 =item check
68
69 Checks all fields to make sure this is a valid record.  If there is an error,
70 returns the error, otherwise returns false.  Called by the insert and replace
71 methods.
72
73 =cut
74
75 sub check {
76   my $self = shift;
77   my $error = '';
78
79   $self->name =~ /^([a-z0-9_\-\.]{1,15})$/i
80     or return "Invalid field name for part_ac_field";
81
82   ''; #no error
83 }
84
85
86 =back
87
88 =head1 VERSION
89
90 $Id: 
91
92 =head1 BUGS
93
94 =head1 SEE ALSO
95
96 L<FS::svc_broadband>, L<FS::ac>, L<FS::ac_block>, L<FS::ac_field>,  schema.html
97 from the base documentation.
98
99 =cut
100
101 1;
102