FHA Class Definitions of Properties and Methods

FHA Class Definitions of Properties and Methods

Dblink
Property
linkdefined link to a MYSQL database
debuggingDefault FALSE. Can be used to turn on debugging printouts for all subordinate classes
Method
__construct()echoes <h1>…</h1> MYSQLI error message if failure, Otherwise normal return.

RunSql
Properties
RawDataFor SELECT queries, contains the results of the last SQL query as an array of associative indexed rows. If no rows read, an empty array.
ErrorMYQLI error message, if the query caused one, empty string otherwise
RowsCount of the number of affected rows from the last SQL operarion.
Methods
__construct($sql)Prepares to run a query, and runs it if $sql is provided as an argument
runSQL($sql)Runs the query in $sql

Residence
Properties
AddressStreet address, e.g., 333 Elm (lotno if different)
HPhoneHome Phone if it exists
HEmailHome email address, if it exists
HFaxHome FAX if it exists
EmailPersonal email, if provided, or household email if not, or empty string if neither
PhoneHousehold, personal, or cell, whichever’s first, formatted. empty string if none
LotLot number
Methods
__construct($lot)Set Lot-related peoperties. Returns FALSE if no $lot or if $lot not in database.
allResidents()Returns a 0-indexed array of the pIDs for all residents at Lot’s address.

fhaResident
Properties
pIDIndex to record in tblNamesX database table
LNameLast name
FNameIInformal first name, e.g., “Barry”
NameIInformal full name, e.g., “Barry Obama”
FNameFFormal 1st name, e.g., “President Barack H. (Barry)”
NameFFull formal name, e.g., “President Barack H. (Barry) Obama”
PEmailPersonal Email (if any)
PPhonePersonal Phone (formatted, if any)
PBPhonePersonal Business Phone (formatted, if any)
PCellPersonal Cell phone no. (formatted, if any)
Methods
__construct($x)$x can be a pID index to Names table, or a row from this table, as an associative array. Sets all properties.

Bbtopics
Properties
aryTopicsList of fetched topics as a zero-based array, one element per topic.
TopicsString of topics as returned from getTopics method.
RowsCount of the number of rows in RawData array (might be zero).
Methods
__construct($sql)Prepares tofetch the latest “n” topis from the (Bulletin) Board
setNumber($n)Sets the number of topics to retrieve (if not set, $n=25)
setSeparator($string)Sets the string that separates the returned topics (default = ‘|||’)
getTopics($n)Retrieves the latest “n” topics from the (Bulletin) Board, returns then as a “$string” separated character string

Acymailer
Property
errsArray of errors, if any
Methods
__construct()Set up ACYMailing suport
setSubject($subj)Set email subject (required)
setBody($text)Set email body text (required)
setFromName($from)Set human-readable name for sender
setFromEmail($fromEmail)Set email for sender
setReplyName($rply)Set reply-to name
setReplyEmail($rplyEmail)Set reply-to email
unsetTo()Clear all addressees
setTo( $something )Set addressees (a single email or an array)
setTemplate($templid)Set the ACYMailing template ID (default is 25 – only font formatting)
queueEmail( $mid)If $mid is not provided, build the email with all provided data, diagnose missing parts and queue it. If $mid is provided, send the ACYMailing email as defined in ACYMailing.