1 package FS::access_user_page_pref;
2 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
7 sub table { 'access_user_page_pref'; }
11 FS::access_user_page_pref - Object methods for access_user_page_pref records
15 use FS::access_user_page_pref;
17 $record = new FS::access_user_page_pref \%hash;
18 $record = new FS::access_user_page_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_page_pref object represents a per-page user interface
31 preference. FS::access_user_page_pref inherits from FS::Record. The
32 following fields are currently supported:
42 The user who has this preference, a L<FS::access_user> foreign key.
46 The path of the page where the preference is set, relative to the Mason
51 For view and edit pages (which show one record at a time), the record primary
52 key that the preference applies to.
56 The date the preference was created.
60 The name of the preference, as defined by the page.
64 The value (a free-text field).
74 Creates a new preference. To add the preference to the database, see
79 Adds this record to the database. If there is an error, returns the error,
80 otherwise returns false.
84 Delete this record from the database.
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 Checks all fields to make sure this is a valid preference. If there is
94 an error, returns the error, otherwise returns false. Called by the insert
102 $self->set('_date', time) unless $self->get('_date');
105 $self->ut_numbern('prefnum')
106 || $self->ut_number('usernum')
107 || $self->ut_foreign_key('usernum', 'access_user', 'usernum')
108 || $self->ut_text('path')
109 || $self->ut_numbern('tablenum')
110 || $self->ut_numbern('_date')
111 || $self->ut_text('prefname')
112 || $self->ut_text('prefvalue')
114 return $error if $error;