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
41 =item disabled - Disabled flag, empty or 'Y'
47 These were called B<referrals> before version 1.4.0 - the name was changed
48 so as not to be confused with the new customer-to-customer referrals.
56 Creates a new advertising source. To add the referral to the database, see
61 sub table { 'part_referral'; }
65 Adds this advertising source to the database. If there is an error, returns
66 the error, otherwise returns false.
70 Currently unimplemented.
76 return "Can't (yet?) delete part_referral records";
77 #need to make sure no customers have this referral!
80 =item replace OLD_RECORD
82 Replaces OLD_RECORD with this one in the database. If there is an error,
83 returns the error, otherwise returns false.
87 Checks all fields to make sure this is a valid advertising source. If there is
88 an error, returns the error, otherwise returns false. Called by the insert and
96 my $error = $self->ut_numbern('refnum')
97 || $self->ut_text('referral')
99 return $error if $error;
101 if ( $self->dbdef_table->column('disabled') ) {
102 $error = $self->ut_enum('disabled', [ '', 'Y' ] );
103 return $error if $error;
113 The delete method is unimplemented.
115 `Advertising source'. Yes, it's a sucky name. The only other ones I could
116 come up with were "Marketing channel" and "Heard Abouts" and those are
117 definately both worse.
121 L<FS::Record>, L<FS::cust_main>, schema.html from the base documentation.