Documentation

CRM_GCD
in package

Class CRM_GCD

Table of Contents

Constants

ADD_TO_DB  = \TRUE
CHILD_OF  = 1
DATA_FILENAME  = "sample_data.xml"
constants
DEBUG_LEVEL  = 1
HEAD_OF_HOUSEHOLD  = 6
HOME  = 1
HOUSEHOLD_PERCENT  = 15
INDIVIDUAL_PERCENT  = 75
MAIN  = 3
MEMBER_OF_HOUSEHOLD  = 7
NUM_ACTIVITY  = 150
NUM_CONTACT  = 5000
NUM_CONTRIBUTION  = 2000
NUM_DOMAIN  = 1
NUM_INDIVIDUAL_PER_HOUSEHOLD  = 4
NUM_MEMBERSHIP  = 2000
NUM_PARTICIPANT  = 2000
ORGANIZATION_PERCENT  = 10
OTHER  = 4
SIBLING_OF  = 3
SPOUSE_OF  = 2
WORK  = 2

Properties

$activity_type  : mixed
$addressDirection  : mixed
$callback  : mixed
$city  : mixed
$contact  : array<string|int, mixed>
store contact id's
$contactType  : mixed
$country  : mixed
$CSC  : mixed
$degree  : mixed
$domain  : array<string|int, mixed>
store domain id's
$emailDomain  : mixed
$emailTLD  : mixed
$firstName  : array<string|int, mixed>
store names, firstnames, street 1, street2
$gender  : mixed
$greetingType  : mixed
$group  : mixed
$groupMembershipStatus  : array<string|int, mixed>
$household  : mixed
$householdIndividual  : mixed
$individual  : mixed
$lastName  : mixed
$module  : mixed
$note  : mixed
$numHousehold  : mixed
$numIndividual  : int
private vars
$numOrganization  : mixed
$numStrictIndividual  : mixed
$organization  : mixed
$organizationField  : mixed
$organizationName  : mixed
$organizationType  : mixed
$party_registration  : mixed
$phoneType  : mixed
$preferredCommunicationMethod  : array<string|int, mixed>
enum's from database
$prefix  : array<string|int, mixed>
customizable enums (foreign keys)
$sampleData  : int
sample data in xml format
$school  : mixed
$state  : mixed
$streetName  : mixed
$streetType  : mixed
$strictIndividual  : array<string|int, mixed>
stores the strict individual id and household id to individual id mapping
$subscriptionHistoryMethod  : mixed
$suffix  : mixed
$supplementalAddress1  : mixed

Methods

__construct()  : mixed
Start of public functions
addActivity()  : mixed
addActivity()
addContact()  : mixed
addContact()
addContribution()  : mixed
addDomain()  : mixed
addDomain()
addEntityTag()  : mixed
addTagEntity()
addGroup()  : mixed
addGroup()
addHousehold()  : mixed
addHousehold()
addIndividual()  : mixed
addIndividual()
addLocation()  : mixed
addLocation()
addMembership()  : mixed
addMembershipLog()  : mixed
addMembershipPayment()  : mixed
addMembershipType()  : mixed
addNote()  : mixed
addNote()
addOrganization()  : mixed
addOrganization()
addParticipant()  : mixed
addPCP()  : mixed
addPledge()  : mixed
addPledgePayment()  : mixed
addRelationship()  : mixed
addRelationship()
addSoftContribution()  : mixed
createEvent()  : mixed
getContactType()  : string
getLatLong()  : array<string|int, mixed>
getZipCodeInfo()  : array<string|int, mixed>
initDB()  : mixed
initID()  : mixed
this function creates arrays for the following
parseDataFile()  : mixed
randomName()  : string
repairDate()  : string
_addAddress()  : mixed
_addEmail()  : mixed
_addLocation()  : mixed
_addPhone()  : mixed
_getRandomChar()  : string
_getRandomCSC()  : array<string|int, mixed>
_getRandomDate()  : string
Generate a random date.
_getRandomElement()  : mixed
_getRandomIndex()  : int
_getRandomString()  : mixed
Get a randomly generated string.
_insert()  : mixed
_insertNote()  : mixed
Insert a note
_sortNameToEmail()  : mixed
_update()  : mixed
getRandomBoolean()  : int

Constants

Properties

$contact

store contact id's

private array<string|int, mixed> $contact = array()

$contactType

private mixed $contactType = array('Individual', 'Household', 'Organization')

$CSC

private mixed $CSC = array( // united states 1228 => array( // california 1004 => array('San Francisco', 'Los Angeles', 'Palo Alto'), // new york 1031 => array('New York', 'Albany'), ), // india 1101 => array( // maharashtra 1113 => array('Mumbai', 'Pune', 'Nasik'), // karnataka 1114 => array('Bangalore', 'Mangalore', 'Udipi'), ), // poland 1172 => array( // mazowieckie 1115 => array('Warszawa', 'Płock'), // pomorskie 1116 => array('Gdańsk', 'Gdynia'), ), )

$firstName

store names, firstnames, street 1, street2

private array<string|int, mixed> $firstName = array()

$greetingType

private mixed $greetingType = array(1 => 'Dear [first]', 2 => 'Dear [prefix] [first] [last]', 3 => 'Dear [prefix] [last]')

$groupMembershipStatus

private array<string|int, mixed> $groupMembershipStatus = array('Added', 'Removed', 'Pending')

$preferredCommunicationMethod

enum's from database

private array<string|int, mixed> $preferredCommunicationMethod = array('1', '2', '3', '4', '5')

$prefix

customizable enums (foreign keys)

private array<string|int, mixed> $prefix = array(1 => 'Mrs', 2 => 'Ms', 3 => 'Mr', 4 => 'Dr')

$strictIndividual

stores the strict individual id and household id to individual id mapping

private array<string|int, mixed> $strictIndividual = array()

$subscriptionHistoryMethod

private mixed $subscriptionHistoryMethod = array('Admin', 'Email')

Methods

addActivity()

addActivity()

public addActivity() : mixed

This method populates the crm_activity_history table

addContact()

addContact()

public addContact() : mixed

This method adds data to the contact table

id - from $contact contact_type 'Individual' 'Household' 'Organization' preferred_communication (random 1 to 3)

addDomain()

addDomain()

public addDomain() : mixed

This method adds NUM_DOMAIN domains and then adds NUM_REVISION revisions for each domain with the latest revision being the last one..

addEntityTag()

addTagEntity()

public addEntityTag() : mixed

This method populates the crm_entity_tag table

addGroup()

addGroup()

public addGroup() : mixed

This method populates the crm_entity_tag table

addHousehold()

addHousehold()

public addHousehold() : mixed

This method adds household's data to the contact table

The following fields are generated and added.

contact_uuid - household_individual contact_rid - latest one household_name 'household $contact_uuid primary contact $primary_contact_uuid' nick_name 'nick $contact_uuid' primary_contact_uuid = $household_individual[$contact_uuid][0];

addIndividual()

addIndividual()

public addIndividual() : mixed

This method adds individual's data to the contact table

The following fields are generated and added.

contact_uuid - individual contact_rid - latest one first_name 'First Name $contact_uuid' middle_name 'Middle Name $contact_uuid' last_name 'Last Name $contact_uuid' job_title 'Job Title $contact_uuid' greeting_type - randomly select from the enum values custom_greeting - "custom greeting $contact_uuid'

addLocation()

addLocation()

public addLocation() : mixed

This method adds data to the location table

addNote()

addNote()

public addNote() : mixed

This method populates the crm_note table

addOrganization()

addOrganization()

public addOrganization() : mixed

This method adds organization data to the contact table

The following fields are generated and added.

contact_uuid - organization contact_rid - latest one organization_name 'organization $contact_uuid' legal_name 'legal $contact_uuid' nick_name 'nick $contact_uuid' sic_code 'sic $contact_uuid' primary_contact_id - random individual contact uuid

addRelationship()

addRelationship()

public addRelationship() : mixed

This method adds data to the contact_relationship table

it adds the following fields

getContactType()

public getContactType(mixed $id) : string
Parameters
$id : mixed
Return values
string

getLatLong()

public static getLatLong(mixed $zipCode) : array<string|int, mixed>
Parameters
$zipCode : mixed
Return values
array<string|int, mixed>

getZipCodeInfo()

public static getZipCodeInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

initID()

this function creates arrays for the following

public initID() : mixed

domain id contact id contact_location id contact_contact_location id contact_email uuid contact_phone_uuid contact_instant_message uuid contact_relationship uuid contact_task uuid contact_note uuid

repairDate()

public static repairDate(mixed $date) : string
Parameters
$date : mixed
Return values
string

_addAddress()

private _addAddress(mixed $locationTypeId, mixed $contactId[, bool $isPrimary = FALSE ][, null $locationBlockID = NULL ][, int $offset = 1 ]) : mixed
Parameters
$locationTypeId : mixed
$contactId : mixed
$isPrimary : bool = FALSE
$locationBlockID : null = NULL
$offset : int = 1

_addEmail()

private _addEmail(mixed $locationTypeId, mixed $contactId, mixed $sortName[, bool $isPrimary = FALSE ][, null $locationBlockID = NULL ][, int $offset = 1 ]) : mixed
Parameters
$locationTypeId : mixed
$contactId : mixed
$sortName : mixed
$isPrimary : bool = FALSE
$locationBlockID : null = NULL
$offset : int = 1

_addLocation()

private _addLocation(mixed $locationTypeId, mixed $contactId[, bool $domain = FALSE ][, bool $isPrimary = TRUE ]) : mixed
Parameters
$locationTypeId : mixed
$contactId : mixed
$domain : bool = FALSE
$isPrimary : bool = TRUE

_addPhone()

private _addPhone(mixed $locationTypeId, mixed $contactId, mixed $phoneType[, bool $isPrimary = FALSE ][, null $locationBlockID = NULL ][, int $offset = 1 ]) : mixed
Parameters
$locationTypeId : mixed
$contactId : mixed
$phoneType : mixed
$isPrimary : bool = FALSE
$locationBlockID : null = NULL
$offset : int = 1

_getRandomCSC()

private _getRandomCSC() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getRandomDate()

Generate a random date.

private _getRandomDate([int $startDate = 0 ][, int $endDate = 0 ]) : string

If both $startDate and $endDate are defined generate date between them.

If only startDate is specified then date generated is between startDate + 1 year.

if only endDate is specified then date generated is between endDate - 1 year.

if none are specified - date is between today - 1year and today

Parameters
$startDate : int = 0

Start Date in Unix timestamp

$endDate : int = 0

End Date in Unix timestamp

Tags
access

private

Return values
string

randomly generated date in the format "Ymd"

_getRandomElement()

private _getRandomElement(mixed &$array1) : mixed
Parameters
$array1 : mixed

_getRandomIndex()

private _getRandomIndex(mixed &$array1) : int
Parameters
$array1 : mixed
Return values
int

_getRandomString()

Get a randomly generated string.

private _getRandomString([int $size = 32 ]) : mixed
Parameters
$size : int = 32

_insertNote()

Insert a note

private _insertNote(mixed $note) : mixed

Helper function which randomly populates "note" and "date_modified" and inserts it.

Parameters
$note : mixed
Tags
access

private

_sortNameToEmail()

private _sortNameToEmail(mixed $sortName) : mixed
Parameters
$sortName : mixed

        
On this page

Search results