1 package FS::phone_avail;
5 use FS::Record qw( qsearch qsearchs );
11 FS::phone_avail - Phone number availability cache
17 $record = new FS::phone_avail \%hash;
18 $record = new FS::phone_avail { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::phone_avail object represents availability of phone service.
31 FS::phone_avail inherits from FS::Record. The following fields are currently
68 Creates a new record. To add the record to the database, see L<"insert">.
70 Note that this stores the hash reference, not a distinct copy of the hash it
71 points to. You can ask the object for a copy with the I<hash> method.
75 # the new method can be inherited from FS::Record, if a table method is defined
77 sub table { 'phone_avail'; }
81 Adds this record to the database. If there is an error, returns the error,
82 otherwise returns false.
86 # the insert method can be inherited from FS::Record
90 Delete this record from the database.
94 # the delete method can be inherited from FS::Record
96 =item replace OLD_RECORD
98 Replaces the OLD_RECORD with this one in the database. If there is an error,
99 returns the error, otherwise returns false.
103 # the replace method can be inherited from FS::Record
107 Checks all fields to make sure this is a valid record. If there is
108 an error, returns the error, otherwise returns false. Called by the insert
113 # the check method should currently be supplied - FS::Record contains some
114 # data checking routines
120 $self->ut_numbern('availnum')
121 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum' )
122 || $self->ut_number('countrycode')
123 || $self->ut_alphan('state')
124 || $self->ut_number('npa')
125 || $self->ut_numbern('nxx')
127 return $error if $error;
136 Sparse documentation.
140 L<FS::Record>, schema.html from the base documentation.