MemberVariable
MemberVariable PHP Methods
 add(array $fieldValues) v5
Adds a new record.
PARAMETERS: 
$fieldValues = Array of the values for each column when adding the record (Associative array with key = field name & value = field value).
RETURN VALUE: 
int = id of the new record.
0 = if fails checkLoaded() v5
Checks if record is loaded. throwing an error if the record failed to load successfully.
PARAMETERS: 
NONE 
RETURN VALUE: 
VOID convertHTML(string $htmlContent = "", string $prefix = "", bool $urlEncode = false) v5
Converts ~~ variables in the $htmlContent that is provided and returns the converted content. The title of the ~~ variables are converted by the content from the column in the database with the matching title.	
PARAMETERS: 
$htmlContent = String, HTML content body to convert.
$prefix= String, tilde code prefix if any.
$urlEncode = Bool, true if you want to apply URL encode to the content, false otherwise
RETURN VALUE: 
String = Converted HTML delete(string $restoreQuery = "") v5
Deletes the loaded record from the database.
PARAMETERS: 
$restoreQuery  = FOR INTERNAL USE. FOR TYPICAL USAGE LEAVE THIS BLANK. The restore query to pass along when deleting an object with dependencies.
RETURN VALUE: 
VOID duplicate(array $newValues = null) v5
Creates a duplicate record in the database of the current object
PARAMETERS: 
$newValues = array, associative array with field name as key and field value as array value containing the new values if any
RETURN VALUE: 
int =  the id of the new record. function load(string $queryWhere) v5
Loads values for the record matching the criteria specified by $queryWhere. If the there is more than one record returned from the query then only the first record is loaded. 
PARAMETERS: 
$queryWhere = String, SQL where query.
RETURN VALUE: 
Bool = true, if success, false otherwise getDatabaseName() v5
Returns object's database table name
PARAMETERS: 
NONE
RETURN VALUE: 
String = Database name getDefaultTRHTML() v5
Returns the default html code for a tr row with all of the fields from the database in it as ~~ vars
PARAMETERS: 
NONE
RETURN VALUE: 
String = the default HTML  code for a tr row with all of the fields from the database in it as ~~ vars getDefaultValueHTML() v5
Replaces ~defaultvalue~ tilde code with member variable default value
PARAMETERS:
NONE
RETURN VALUE:
String = $defaultValueHTML after converting the default value tilde code getFieldTypeString() v5
Get field type for the loaded member variable
PARAMETERS:
NONE
RETURN VALUE:
String = field type for the loaded member variable like (text/textarea/options etc) getID() v5
Sets object ID
PARAMETERS: 
NONE 
RETURN VALUE: 
int = ID getInput($miscTRMemberVar, $member = null) v5
Gets HTML input field for the loaded member variable
PARAMETERS:
$miscTRMemberVar = string, HTML template of the member variable field
$member = object, load member's default value if the field value is empty
RETURN VALUE:
String = HTML input field for the loaded member variable getJSON(bool $returnArr = false) v5
Get JSON array for the loaded record.
PARAMETERS: 
Bool = true if want to return JSON, false otherwise
RETURN VALUE: 
Object Array or JSON encoded version of the array getLocationHTML() v5
Gets where the member variable will show (in join page or in profile or settings)
PARAMETERS:
NONE
RETURN VALUE:
String = HTML badge containing list of locations where the member variable will show getMembershipsHTML() v5
Gets loaded member variable HTML row including title and access memberships
PARAMETERS:
NONE
RETURN VALUE:
string = loaded member variable HTML row including title and access memberships getOnCreateString() v5
Checks if the member variable is set to show on join page 
PARAMETERS:
NONE
RETURN VALUE:
String = text specifying if the member variable is set to show on the join page getValue(string $fieldName = "value") v5
Returns the value from a specific column for this record.
PARAMETERS: 
$fieldName = String, field name.
RETURN VALUE: 
Field value hasField(string $fieldName) v5
Checks if the field shown or hidden
PARAMETERS: 
$fieldName= String, Field title. 
RETURN VALUE: 
Bool= True if the field show is true, false otherwise hideAllFields() v5
hides all fields(columns)
PARAMETERS: 
NONE
RETURN VALUE: 
VOID hideField($fieldTitle) v5
Hides specific field title by its column title
PARAMETERS: 
$fieldTitle = String, Field title.
RETURN VALUE: 
VOID isLoaded() v5
Checks if an object is loaded correctly (can be used to check if ID exists).
PARAMETERS: 
NONE 
RETURN VALUE: 
Bool = True if the object loaded successfully, false otherwise loadFirstID() v5
Get object's first id
PARAMETERS: 
NONE
RETURN VALUE: 
int = First ID loadID(int $id) v5
Loads values for the record with the id specified.
PARAMETERS: 
$id = int, record ID.
RETURN VALUE: 
Bool = true, if success, false otherwise save(array $fieldValues) v5
Saves the record with the new values specified in the $fieldValuesarray.
PARAMETERS: 
$fieldValues = Array of the values for each column when adding the record (Associative array with key = field name & value = field value).
RETURN VALUE: 
Bool = True on success, False otherwise. setDefaultValueHTML(string $html) v5
Set HTML for the default value for the loaded member variable
PARAMETERS:
$html = string, HTML for the member variable default value
RETURN VALUE:
VOID setMembershipsHTML(string $html, array $membershipTitleArr) v5
Set HTML for the memberships list for the loaded member variable
PARAMETERS:
$html = string, HTML for the member variable membership access list
$membershipTitleArr = array, memberships title
RETURN VALUE:
VOID setMyMemberID(int $memberID) v5
Sets member's ID
PARAMETERS: 
$memberID = int, member id
RETURN VALUE: 
VOID setRestoreID(int $id) v5
Sets restor point ID
PARAMETERS: 
$id = int, restore ID
RETURN VALUE: 
VOID settingHTTPS(bool $useHTTPS = true) v5
Sets site to use https or http 
PARAMETERS: 
$useHTTPS  = True if https on, false otherwise (default true). 
RETURN VALUE: 
VOID settingPreloadDefault(bool $preloadDefault = true) v5
Change settings for member variable preload default
PARAMETERS:
$preloadDefault = bool, true to preload default, false otherwise
RETURN VALUE:
VOID settingSiteURL(string $siteURL) v5
Sets Site Domain
PARAMETERS: 
$siteURL = String, site URL
RETURN VALUE: 
VOID showAllFields() v5
Show all fields(columns)
PARAMETERS: 
NONE
RETURN VALUE: 
VOID showField($fieldTitle) v5
Shows specific field title by its column title
PARAMETERS: 
$fieldTitle = String, Field title.
RETURN VALUE: 
VOIDMemberVariable PHP Variables
🔎︎ %l4610%
Columns in the membervars Database Table:
id    title    description    fieldtype    oncreate    defaultvalue    selectoptions    dorder    membership    passup    location    required    
Code Example
Use the code below to 
view a record in an 
html page:
Use the code below to 
add a record:
Use the code below to 
delete a record: