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
ADD_TO_DB
public
mixed
ADD_TO_DB
= \TRUE
CHILD_OF
public
mixed
CHILD_OF
= 1
DATA_FILENAME
constants
public
mixed
DATA_FILENAME
= "sample_data.xml"
DEBUG_LEVEL
public
mixed
DEBUG_LEVEL
= 1
HEAD_OF_HOUSEHOLD
public
mixed
HEAD_OF_HOUSEHOLD
= 6
HOME
public
mixed
HOME
= 1
HOUSEHOLD_PERCENT
public
mixed
HOUSEHOLD_PERCENT
= 15
INDIVIDUAL_PERCENT
public
mixed
INDIVIDUAL_PERCENT
= 75
MAIN
public
mixed
MAIN
= 3
MEMBER_OF_HOUSEHOLD
public
mixed
MEMBER_OF_HOUSEHOLD
= 7
NUM_ACTIVITY
public
mixed
NUM_ACTIVITY
= 150
NUM_CONTACT
public
mixed
NUM_CONTACT
= 5000
NUM_CONTRIBUTION
public
mixed
NUM_CONTRIBUTION
= 2000
NUM_DOMAIN
public
mixed
NUM_DOMAIN
= 1
NUM_INDIVIDUAL_PER_HOUSEHOLD
public
mixed
NUM_INDIVIDUAL_PER_HOUSEHOLD
= 4
NUM_MEMBERSHIP
public
mixed
NUM_MEMBERSHIP
= 2000
NUM_PARTICIPANT
public
mixed
NUM_PARTICIPANT
= 2000
ORGANIZATION_PERCENT
public
mixed
ORGANIZATION_PERCENT
= 10
OTHER
public
mixed
OTHER
= 4
SIBLING_OF
public
mixed
SIBLING_OF
= 3
SPOUSE_OF
public
mixed
SPOUSE_OF
= 2
WORK
public
mixed
WORK
= 2
Properties
$activity_type
private
mixed
$activity_type
= array()
$addressDirection
private
mixed
$addressDirection
= array()
$callback
private
mixed
$callback
= array()
$city
private
mixed
$city
= array()
$contact
store contact id's
private
array<string|int, mixed>
$contact
= array()
$contactType
private
mixed
$contactType
= array('Individual', 'Household', 'Organization')
$country
private
mixed
$country
= array()
$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'),
),
)
$degree
private
mixed
$degree
= array()
$domain
store domain id's
private
array<string|int, mixed>
$domain
= array()
$emailDomain
private
mixed
$emailDomain
= array()
$emailTLD
private
mixed
$emailTLD
= array()
$firstName
store names, firstnames, street 1, street2
private
array<string|int, mixed>
$firstName
= array()
$gender
private
mixed
$gender
= array(1 => 'Female', 2 => 'Male')
$greetingType
private
mixed
$greetingType
= array(1 => 'Dear [first]', 2 => 'Dear [prefix] [first] [last]', 3 => 'Dear [prefix] [last]')
$group
private
mixed
$group
= array()
$groupMembershipStatus
private
array<string|int, mixed>
$groupMembershipStatus
= array('Added', 'Removed', 'Pending')
$household
private
mixed
$household
= array()
$householdIndividual
private
mixed
$householdIndividual
= array()
$individual
private
mixed
$individual
= array()
$lastName
private
mixed
$lastName
= array()
$module
private
mixed
$module
= array()
$note
private
mixed
$note
= array()
$numHousehold
private
mixed
$numHousehold
= 0
$numIndividual
private vars
private
int
$numIndividual
= 0
$numOrganization
private
mixed
$numOrganization
= 0
$numStrictIndividual
private
mixed
$numStrictIndividual
= 0
$organization
private
mixed
$organization
= array()
$organizationField
private
mixed
$organizationField
= array()
$organizationName
private
mixed
$organizationName
= array()
$organizationType
private
mixed
$organizationType
= array()
$party_registration
private
mixed
$party_registration
= array()
$phoneType
private
mixed
$phoneType
= array('1', '2', '3', '4')
$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')
$sampleData
sample data in xml format
private
int
$sampleData
= \NULL
$school
private
mixed
$school
= array()
$state
private
mixed
$state
= array()
$streetName
private
mixed
$streetName
= array()
$streetType
private
mixed
$streetType
= array()
$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')
$suffix
private
mixed
$suffix
= array(1 => 'Jr', 2 => 'Sr')
$supplementalAddress1
private
mixed
$supplementalAddress1
= array()
Methods
__construct()
Start of public functions
public
__construct() : mixed
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)
addContribution()
public
addContribution() : mixed
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
addMembership()
public
addMembership() : mixed
addMembershipLog()
public
addMembershipLog() : mixed
addMembershipPayment()
public
addMembershipPayment() : mixed
addMembershipType()
public
addMembershipType() : mixed
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
addParticipant()
public
addParticipant() : mixed
addPCP()
public
addPCP() : mixed
addPledge()
public
addPledge() : mixed
addPledgePayment()
public
addPledgePayment() : mixed
addRelationship()
addRelationship()
public
addRelationship() : mixed
This method adds data to the contact_relationship table
it adds the following fields
addSoftContribution()
public
addSoftContribution() : mixed
createEvent()
public
createEvent() : mixed
getContactType()
public
getContactType(mixed $id) : string
Parameters
- $id : mixed
Return values
stringgetLatLong()
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>initDB()
public
initDB() : 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
parseDataFile()
public
parseDataFile() : mixed
randomName()
public
randomName() : string
Return values
stringrepairDate()
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
_getRandomChar()
private
_getRandomChar() : string
Return values
string_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
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
_insert()
private
_insert(mixed &$dao) : mixed
Parameters
- $dao : mixed
_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
_sortNameToEmail()
private
_sortNameToEmail(mixed $sortName) : mixed
Parameters
- $sortName : mixed
_update()
private
_update(mixed $dao) : mixed
Parameters
- $dao : mixed
getRandomBoolean()
private
getRandomBoolean() : int