1 package FS::mailinglistmember;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearchs ); # qsearch );
12 FS::mailinglistmember - Object methods for mailinglistmember records
16 use FS::mailinglistmember;
18 $record = new FS::mailinglistmember \%hash;
19 $record = new FS::mailinglistmember { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::mailinglistmember object represents a mailing list member.
32 FS::mailinglistmember inherits from FS::Record. The following fields are
66 Creates a new mailing list member. To add the member to the database, see
69 Note that this stores the hash reference, not a distinct copy of the hash it
70 points to. You can ask the object for a copy with the I<hash> method.
74 # the new method can be inherited from FS::Record, if a table method is defined
76 sub table { 'mailinglistmember'; }
80 Adds this record to the database. If there is an error, returns the error,
81 otherwise returns false.
85 # the insert method can be inherited from FS::Record
89 Delete this record from the database.
93 # the delete method can be inherited from FS::Record
95 =item replace OLD_RECORD
97 Replaces the OLD_RECORD with this one in the database. If there is an error,
98 returns the error, otherwise returns false.
102 # the replace method can be inherited from FS::Record
106 Checks all fields to make sure this is a valid member. If there is
107 an error, returns the error, otherwise returns false. Called by the insert
112 # the check method should currently be supplied - FS::Record contains some
113 # data checking routines
119 $self->ut_numbern('membernum')
120 || $self->ut_foreign_key('listnum', 'mailinglist', 'listnum')
121 || $self->ut_foreign_keyn('svcnum', 'svc_acct', 'svcnum')
122 || $self->ut_foreign_keyn('contactemailnum', 'contact_email', 'contactemailnum')
123 || $self->ut_textn('email') #XXX ut_email! from svc_forward, cust_main_invoice
125 return $error if $error;
136 qsearchs('mailinglist', { 'listnum' => $self->listnum } );
145 L<FS::Record>, schema.html from the base documentation.