5 #use FS::Record qw( qsearch qsearchs );
13 FS::table_name - Object methods for table_name records
19 $record = new FS::table_name \%hash;
20 $record = new FS::table_name { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
30 $error = $record->suspend;
32 $error = $record->unsuspend;
34 $error = $record->cancel;
38 An FS::table_name object represents an example. FS::table_name inherits from
39 FS::svc_Common. The following fields are currently supported:
43 =item field - description
53 Creates a new example. To add the example to the database, see L<"insert">.
55 Note that this stores the hash reference, not a distinct copy of the hash it
56 points to. You can ask the object for a copy with the I<hash> method.
60 sub table { 'table_name'; }
64 Adds this record to the database. If there is an error, returns the error,
65 otherwise returns false.
67 The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
68 defined. An FS::cust_svc record will be created and inserted.
76 $error = $self->SUPER::insert;
77 return $error if $error;
84 Delete this record from the database.
92 $error = $self->SUPER::delete;
93 return $error if $error;
99 =item replace OLD_RECORD
101 Replaces the OLD_RECORD with this one in the database. If there is an error,
102 returns the error, otherwise returns false.
107 my ( $new, $old ) = ( shift, shift );
110 $error = $new->SUPER::replace($old);
111 return $error if $error;
118 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
122 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
126 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
130 Checks all fields to make sure this is a valid example. If there is
131 an error, returns the error, otherwise returns false. Called by the insert
139 my $x = $self->setfixed;
140 return $x unless ref($x);
151 The author forgot to customize this manpage.
155 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
156 L<FS::cust_pkg>, schema.html from the base documentation.