1 package FS::access_user;
5 use FS::Record qw( qsearch qsearchs );
7 use FS::access_usergroup;
9 @ISA = qw( FS::m2m_Common FS::Record );
13 FS::access_user - Object methods for access_user records
19 $record = new FS::access_user \%hash;
20 $record = new FS::access_user { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
32 An FS::access_user object represents an example. FS::access_user inherits from
33 FS::Record. The following fields are currently supported:
37 =item usernum - primary key
55 Creates a new example. To add the example to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'access_user'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid example. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
100 # the check method should currently be supplied - FS::Record contains some
101 # data checking routines
107 $self->ut_numbern('usernum')
108 || $self->ut_text('username')
109 || $self->ut_text('_password')
110 || $self->ut_text('last')
111 || $self->ut_text('first')
113 return $error if $error;
120 Returns a name string for this user: "Last, First".
126 $self->get('last'). ', '. $self->first;
129 =item access_usergroup
133 sub access_usergroup {
135 qsearch( 'access_usergroup', { 'usernum' => $self->usernum } );
146 #=item access_groupnames
150 #sub access_groupnames {
158 The author forgot to customize this manpage.
162 L<FS::Record>, schema.html from the base documentation.