Freeside:1.9:Documentation:Developer/FS/part referral

From Freeside
< Freeside:1.9:Documentation:Developer‎ | FS
Revision as of 16:50, 3 October 2007 by Ivan (talk | contribs) (import from POD)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::part_referral - Object methods for part_referral objects

SYNOPSIS

 use FS::part_referral;

 $record = new FS::part_referral \%hash
 $record = new FS::part_referral { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::part_referral represents a advertising source - where a customer heard of your services. This can be used to track the effectiveness of a particular piece of advertising, for example. FS::part_referral inherits from FS::Record. The following fields are currently supported:

refnum - primary key (assigned automatically for new referrals); referral - Text name of this advertising source; disabled - Disabled flag, empty or 'Y'; agentnum - Optional agentnum (see FS::agent)

NOTE

These were called referrals before version 1.4.0 - the name was changed so as not to be confused with the new customer-to-customer referrals.

METHODS

new HASHREF
Creates a new advertising source. To add the referral to the database, see "insert"|#insert|"insert".
insert
Adds this advertising source to the database. If there is an error, returns the error, otherwise returns false.
delete
Currently unimplemented.
replace OLD_RECORD
Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid advertising source. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
agent
Returns the associated agent for this referral, if any, as an FS::agent object.

CLASS METHODS

acl_agentnum_sql [ INCLUDE_GLOBAL_BOOL ]
Returns an SQL fragment for searching for part_referral records allowed by the current users's agent ACLs (and "Edit global advertising sources" right).
Pass a true value to include global advertising sources (for example, when simply using rather than editing advertising sources).
all_part_referral [ INCLUDE_GLOBAL_BOOL ]
Returns all part_referral records allowed by the current users's agent ACLs (and "Edit global advertising sources" right).
Pass a true value to include global advertising sources (for example, when simply using rather than editing advertising sources).
num_part_referral [ INCLUDE_GLOBAL_BOOL ]
Returns the number of part_referral records allowed by the current users's agent ACLs (and "Edit global advertising sources" right).

BUGS

The delete method is unimplemented.

`Advertising source'. Yes, it's a sucky name. The only other ones I could come up with were "Marketing channel" and "Heard Abouts" and those are definately both worse.

SEE ALSO

FS::Record, FS::cust_main, schema.html from the base documentation.