http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/contact&feed=atom&action=historyFreeside:4:Documentation:Developer/FS/contact - Revision history2024-03-29T01:13:15ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/contact&diff=9076&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:18:45Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>==NAME==<br />
FS::contact - Object methods for contact records<br />
<br />
==SYNOPSIS==<br />
<code><br />
use FS::contact;<br />
<br />
$record = new FS::contact \%hash;<br />
$record = new FS::contact { 'column' => 'value' };<br />
<br />
$error = $record->insert;<br />
<br />
$error = $new_record->replace($old_record);<br />
<br />
$error = $record->delete;<br />
<br />
$error = $record->check;<br />
</code><br />
==DESCRIPTION==<br />
An FS::contact object represents an specific contact person for a prospect or customer. FS::contact inherits from FS::Record. The following fields are currently supported:<br />
<br />
; contactnum<br />
:primary key<br />
; prospectnum<br />
:prospectnum<br />
; custnum<br />
:custnum<br />
; locationnum<br />
:locationnum<br />
; last<br />
:last<br />
; first<br />
:first<br />
; title<br />
:title<br />
; comment<br />
:comment<br />
; selfservice_access<br />
:empty or Y<br />
; _password; _password_encoding<br />
:empty or bcrypt<br />
; disabled<br />
:disabled<br />
<br />
==METHODS==<br />
; new HASHREF<br />
:Creates a new contact. To add the contact to the database, see [[#insert|"insert"]].<br />
<br />
:Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the ''hash'' method.<br />
; insert<br />
:Adds this record to the database. If there is an error, returns the error, otherwise returns false.<br />
; delete<br />
:Delete this record from the database.<br />
; replace OLD_RECORD<br />
:Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.<br />
; _parse_phonestring PHONENUMBER_STRING<br />
:Subroutine, takes a string and returns a list (suitable for assigning to a hash) with keys 'countrycode', 'phonenum' and 'extension'<br />
<br />
:(Should probably be moved to contact_phone.pm, hence the initial underscore.)<br />
; queue_fuzzyfiles_update<br />
:Used by insert & replace to update the fuzzy search cache<br />
; check<br />
:Checks all fields to make sure this is a valid contact. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.<br />
; line<br />
:Returns a formatted string representing this contact, including name, title and comment.<br />
; firstlast<br />
:Returns a formatted string representing this contact, with just the name.<br />
; by_selfservice_email EMAILADDRESS<br />
:Alternate search constructor (class method). Given an email address, returns the contact for that address, or the empty string if no contact has that email address.<br />
; cgi_contact_fields<br />
:Returns a list reference containing the set of contact fields used in the web interface for one-line editing (i.e. excluding contactnum, prospectnum, custnum and locationnum, as well as password fields, but including fields for contact_email and contact_phone records.)<br />
<br />
==BUGS==<br />
==SEE ALSO==<br />
[[Freeside:4:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.</div>Jeremyd