4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::areacode - Object methods for areacode records
15 $record = new FS::areacode \%hash;
16 $record = new FS::areacode { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::areacode object represents an area code. FS::areacode inherits from
29 FS::Record. The following fields are currently supported:
33 =item areanum - primary key
35 =item code - area code
37 =item country - two-letter country code
39 =item state - two-letter state code, if appropriate
41 =item description - description (optional)
51 sub table { 'areacode'; }
55 Adds this record to the database. If there is an error, returns the error,
56 otherwise returns false.
62 Delete this record from the database.
66 =item replace OLD_RECORD
68 Replaces the OLD_RECORD with this one in the database. If there is an error,
69 returns the error, otherwise returns false.
75 Checks all fields to make sure this is a valid example. If there is
76 an error, returns the error, otherwise returns false. Called by the insert
81 # the check method should currently be supplied - FS::Record contains some
82 # data checking routines
88 $self->ut_numbern('areanum')
89 || $self->ut_number('code')
90 || $self->ut_text('country')
91 || $self->ut_textn('state')
92 || $self->ut_textn('description')
94 return $error if $error;
105 Returns the country, state, and description for an area code.
112 my $areacode = qsearchs('areacode', { code => $code })
114 return ($areacode->country, $areacode->state, $areacode->description);
119 L<FS::Record>, schema.html from the base documentation.