4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::nas - Object methods for nas records
15 $record = new FS::nas \%hash;
16 $record = new FS::nas { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::nas object represents a RADIUS client. FS::nas inherits from
29 FS::Record. The following fields are currently supported:
78 Creates a new NAS. To add the NAS to the database, see L<"insert">.
80 Note that this stores the hash reference, not a distinct copy of the hash it
81 points to. You can ask the object for a copy with the I<hash> method.
85 # the new method can be inherited from FS::Record, if a table method is defined
91 Adds this record to the database. If there is an error, returns the error,
92 otherwise returns false.
96 # the insert method can be inherited from FS::Record
100 Delete this record from the database.
104 # the delete method can be inherited from FS::Record
106 =item replace OLD_RECORD
108 Replaces the OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
113 # the replace method can be inherited from FS::Record
117 Checks all fields to make sure this is a valid NAS. If there is
118 an error, returns the error, otherwise returns false. Called by the insert
123 # the check method should currently be supplied - FS::Record contains some
124 # data checking routines
130 $self->ut_numbern('nasnum')
131 || $self->ut_text('nasname')
132 || $self->ut_textn('shortname')
133 || $self->ut_text('type')
134 || $self->ut_numbern('ports')
135 || $self->ut_text('secret')
136 || $self->ut_textn('server')
137 || $self->ut_textn('community')
138 || $self->ut_text('description')
140 return $error if $error;
151 L<FS::Record>, schema.html from the base documentation.