1 package FS::tower_sector;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearchs ); # qsearch );
10 FS::tower_sector - Object methods for tower_sector records
16 $record = new FS::tower_sector \%hash;
17 $record = new FS::tower_sector { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::tower_sector object represents an example. FS::tower_sector inherits from
30 FS::Record. The following fields are currently supported:
59 Creates a new example. To add the example to the database, see L<"insert">.
61 Note that this stores the hash reference, not a distinct copy of the hash it
62 points to. You can ask the object for a copy with the I<hash> method.
66 # the new method can be inherited from FS::Record, if a table method is defined
68 sub table { 'tower_sector'; }
72 Adds this record to the database. If there is an error, returns the error,
73 otherwise returns false.
77 # the insert method can be inherited from FS::Record
81 Delete this record from the database.
85 # the delete method can be inherited from FS::Record
87 =item replace OLD_RECORD
89 Replaces the OLD_RECORD with this one in the database. If there is an error,
90 returns the error, otherwise returns false.
94 # the replace method can be inherited from FS::Record
98 Checks all fields to make sure this is a valid example. If there is
99 an error, returns the error, otherwise returns false. Called by the insert
104 # the check method should currently be supplied - FS::Record contains some
105 # data checking routines
111 $self->ut_numbern('sectornum')
112 || $self->ut_number('towernum', 'tower', 'towernum')
113 || $self->ut_text('sectorname')
114 || $self->ut_textn('ip_addr')
116 return $error if $error;
123 Returns the tower for this sector, as an FS::tower object (see L<FS::tower>).
129 qsearchs('tower', { 'towernum'=>$self->towernum } );
134 Returns a description for this sector including tower name.
140 if ( $self->sectorname eq '_default' ) {
141 $self->tower->towername
144 $self->tower->towername. ' sector '. $self->sectorname
154 L<FS::tower>, L<FS::Record>, schema.html from the base documentation.