1 package FS::access_user_pref;
5 use FS::Record qw( qsearch qsearchs );
11 FS::access_user_pref - Object methods for access_user_pref records
15 use FS::access_user_pref;
17 $record = new FS::access_user_pref \%hash;
18 $record = new FS::access_user_pref { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::access_user_pref object represents an per-user preference. Preferenaces
31 are also used to store transient state information (server-side "cookies").
32 FS::access_user_pref inherits from FS::Record. The following fields are
37 =item prefnum - primary key
39 =item usernum - Internal access user (see L<FS::access_user>)
55 Creates a new preference. To add the preference 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_pref'; }
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 preference. 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('prefnum')
108 || $self->ut_number('usernum')
109 || $self->ut_text('prefname')
110 #|| $self->ut_textn('prefvalue')
111 || $self->ut_anything('prefvalue')
113 return $error if $error;
124 L<FS::access_user>, L<FS::Record>, schema.html from the base documentation.