1 package FS::part_referral;
7 @ISA = qw( FS::Record );
11 FS::part_referral - Object methods for part_referral objects
15 use FS::part_referral;
17 $record = new FS::part_referral \%hash
18 $record = new FS::part_referral { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::part_referral represents a advertising source - where a customer heard
31 of your services. This can be used to track the effectiveness of a particular
32 piece of advertising, for example. FS::part_referral inherits from FS::Record.
33 The following fields are currently supported:
37 =item refnum - primary key (assigned automatically for new referrals)
39 =item referral - Text name of this advertising source
45 These were called B<referrals> before version 1.4.0 - the name was changed
46 so as not to be confused with the new customer-to-customer referrals.
54 Creates a new advertising source. To add the referral to the database, see
59 sub table { 'part_referral'; }
63 Adds this advertising source to the database. If there is an error, returns
64 the error, otherwise returns false.
68 Currently unimplemented.
74 return "Can't (yet?) delete part_referral records";
75 #need to make sure no customers have this referral!
78 =item replace OLD_RECORD
80 Replaces OLD_RECORD with this one in the database. If there is an error,
81 returns the error, otherwise returns false.
85 Checks all fields to make sure this is a valid advertising source. If there is
86 an error, returns the error, otherwise returns false. Called by the insert and
94 $self->ut_numbern('refnum')
95 || $self->ut_text('referral')
103 The delete method is unimplemented.
105 `Advertising source'. Yes, it's a sucky name. The only other ones I could
106 come up with were "Marketing channel" and "Heard Abouts" and those are
107 definately both worse.
111 L<FS::Record>, L<FS::cust_main>, schema.html from the base documentation.