4 use base qw( FS::o2m_Common FS::Record );
5 use FS::Record qw( qsearch ); #qsearchs );
10 FS::tower - Object methods for tower records
16 $record = new FS::tower \%hash;
17 $record = new FS::tower { '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 object represents a tower. FS::tower inherits from
30 FS::Record. The following fields are currently supported:
44 Disabled flag, empty or 'Y'
54 Creates a new tower. To add the tower to the database, see L<"insert">.
56 Note that this stores the hash reference, not a distinct copy of the hash it
57 points to. You can ask the object for a copy with the I<hash> method.
61 # the new method can be inherited from FS::Record, if a table method is defined
63 sub table { 'tower'; }
67 Adds this record to the database. If there is an error, returns the error,
68 otherwise returns false.
72 # the insert method can be inherited from FS::Record
76 Delete this record from the database.
80 # the delete method can be inherited from FS::Record
82 =item replace OLD_RECORD
84 Replaces the OLD_RECORD with this one in the database. If there is an error,
85 returns the error, otherwise returns false.
89 # the replace method can be inherited from FS::Record
93 Checks all fields to make sure this is a valid tower. If there is
94 an error, returns the error, otherwise returns false. Called by the insert
99 # the check method should currently be supplied - FS::Record contains some
100 # data checking routines
106 $self->ut_numbern('towernum')
107 || $self->ut_text('towername')
108 || $self->ut_enum('disabled', [ '', 'Y' ])
110 return $error if $error;
117 Returns the sectors of this tower, as FS::tower_sector objects (see
118 L<FS::tower_sector>).
125 'table' => 'tower_sector',
126 'hashref' => { 'towernum' => $self->towernum },
127 'order_by' => 'ORDER BY sectorname',
137 L<FS::tower_sector>, L<FS::svc_broadband>, L<FS::Record>