1 package FS::torrus_srvderive;
4 use base qw( FS::m2name_Common FS::Record );
5 use FS::Record qw( qsearch qsearchs );
6 use FS::torrus_srvderive_component;
10 FS::torrus_srvderive - Object methods for torrus_srvderive records
14 use FS::torrus_srvderive;
16 $record = new FS::torrus_srvderive \%hash;
17 $record = new FS::torrus_srvderive { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::torrus_srvderive object represents a Torrus virtual service ID.
30 FS::torrus_srvderive inherits from FS::Record. The following fields are
56 Creates a new record. To add the record to the database, see L<"insert">.
58 Note that this stores the hash reference, not a distinct copy of the hash it
59 points to. You can ask the object for a copy with the I<hash> method.
63 # the new method can be inherited from FS::Record, if a table method is defined
65 sub table { 'torrus_srvderive'; }
69 Adds this record to the database. If there is an error, returns the error,
70 otherwise returns false.
74 # the insert method can be inherited from FS::Record
78 Delete this record from the database.
82 # the delete method can be inherited from FS::Record
84 =item replace OLD_RECORD
86 Replaces the OLD_RECORD with this one in the database. If there is an error,
87 returns the error, otherwise returns false.
91 # the replace method can be inherited from FS::Record
95 Checks all fields to make sure this is a valid record. If there is
96 an error, returns the error, otherwise returns false. Called by the insert
101 # the check method should currently be supplied - FS::Record contains some
102 # data checking routines
108 $self->ut_numbern('derivenum')
109 || $self->ut_text('serviceid')
110 #|| $self->ut_text('func')
112 return $error if $error;
117 sub torrus_srvderive_component {
119 qsearch('torrus_srvderive_component', { 'derivenum' => $self->derivenum } );
122 sub component_serviceids {
124 map $_->serviceid, $self->torrus_srvderive_component;
133 L<FS::Record>, schema.html from the base documentation.