1 package FS::tower_sector;
2 use base qw( FS::Record );
8 FS::tower_sector - Object methods for tower_sector records
14 $record = new FS::tower_sector \%hash;
15 $record = new FS::tower_sector { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::tower_sector object represents an tower sector. FS::tower_sector
28 inherits from FS::Record. The following fields are currently supported:
57 Creates a new sector. To add the sector to the database, see L<"insert">.
59 Note that this stores the hash reference, not a distinct copy of the hash it
60 points to. You can ask the object for a copy with the I<hash> method.
64 sub table { 'tower_sector'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 Delete this record from the database.
80 #not the most efficient, not not awful, and its not like deleting a sector
81 # with customers is a common operation
82 return "Can't delete a sector with customers" if $self->svc_broadband;
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 Checks all fields to make sure this is a valid sector. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
104 $self->ut_numbern('sectornum')
105 || $self->ut_number('towernum', 'tower', 'towernum')
106 || $self->ut_text('sectorname')
107 || $self->ut_textn('ip_addr')
108 || $self->ut_floatn('height')
109 || $self->ut_numbern('freq_mhz')
110 || $self->ut_numbern('direction')
111 || $self->ut_numbern('width')
112 || $self->ut_floatn('sector_range')
114 return $error if $error;
121 Returns the tower for this sector, as an FS::tower object (see L<FS::tower>).
125 Returns a description for this sector including tower name.
131 if ( $self->sectorname eq '_default' ) {
132 $self->tower->towername
135 $self->tower->towername. ' sector '. $self->sectorname
141 Returns the services on this tower sector.
149 L<FS::tower>, L<FS::Record>, schema.html from the base documentation.