1 package FS::deploy_zone_block;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::deploy_zone_block - Object methods for deploy_zone_block records
13 use FS::deploy_zone_block;
15 $record = new FS::deploy_zone_block \%hash;
16 $record = new FS::deploy_zone_block { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::deploy_zone_block object represents a census block that's part of
29 a deployment zone. FS::deploy_zone_block inherits from FS::Record. The
30 following fields are currently supported:
40 L<FS::deploy_zone> foreign key for the zone.
44 U.S. census block number (15 digits).
48 The year of the census map where the block appeared or was last verified.
58 Creates a new block entry. To add the recordto the database, see L<"insert">.
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 # the new method can be inherited from FS::Record, if a table method is defined
67 sub table { 'deploy_zone_block'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
76 # the insert method can be inherited from FS::Record
80 Delete this record from the database.
84 # the delete method can be inherited from FS::Record
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 # the replace method can be inherited from FS::Record
97 Checks all fields to make sure this is a valid record. If there is
98 an error, returns the error, otherwise returns false. Called by the insert
107 $self->ut_numbern('blocknum')
108 || $self->ut_number('zonenum')
109 || $self->ut_number('censusblock')
110 || $self->ut_number('censusyear')
112 return $error if $error;
114 if ($self->get('censusblock') !~ /^(\d{15})$/) {
115 return "Illegal census block number (must be 15 digits)";