/**
* Public wrapper for calling private "add" functions
* Provides user feedback
+ * @param $itemName
*/
public function generate($itemName) {
echo "Generating $itemName\n";
/*********************************
* private methods
- *********************************/
+ ********************************
+ * @param int $size
+ * @return string
+ */
// get a randomly generated string
private function randomString($size = 32) {
/**
* Automatically manage the is_primary field by tracking which contacts have each item
+ * @param $cid
+ * @param $type
+ * @return int
*/
private function isPrimary($cid, $type) {
if (empty($this->location[$type][$cid])) {
/**
* Execute a query unless we are doing a dry run
* Note: this wrapper should not be used for SELECT queries
+ * @param $query
+ * @param array $params
+ * @return \CRM_Core_DAO
*/
private function _query($query, $params = array()) {
if (self::ADD_TO_DB) {
/**
* Call dao insert method unless we are doing a dry run
+ * @param $dao
*/
private function _insert(&$dao) {
if (self::ADD_TO_DB) {
/**
* Call dao update method unless we are doing a dry run
+ * @param $dao
*/
private function _update(&$dao) {
if (self::ADD_TO_DB) {
/**
* Add core DAO object
+ * @param $type
+ * @param $params
*/
private function _addDAO($type, $params) {
$daoName = "CRM_Core_DAO_$type";
/**
* Fetch contact type based on stored mapping
+ * @param $id
+ * @return
*/
private function getContactType($id) {
foreach (array('Individual', 'Household', 'Organization') as $type) {
private function addPCP() {
$query = "
INSERT INTO `civicrm_pcp`
- (contact_id, status_id, title, intro_text, page_text, donate_link_text, page_id, page_type, is_thermometer, is_honor_roll, goal_amount, currency, is_active, pcp_block_id)
+ (contact_id, status_id, title, intro_text, page_text, donate_link_text, page_id, page_type, is_thermometer, is_honor_roll, goal_amount, currency, is_active, pcp_block_id, is_notify)
VALUES
- ({$this->Individual[3]}, 2, 'My Personal Civi Fundraiser', 'I''m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.', '<p>Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!</p>\r\n<p><a href=\"http://civicrm.org\">You can learn more about CiviCRM here</a>.</p>\r\n<p>Then click the <strong>Contribute Now</strong> button to go to our easy-to-use online contribution form.</p>', 'Contribute Now', 1, 'contribute', 1, 1, 5000.00, 'USD', 1, 1);
+ ({$this->Individual[3]}, 2, 'My Personal Civi Fundraiser', 'I''m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.', '<p>Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!</p>\r\n<p><a href=\"http://civicrm.org\">You can learn more about CiviCRM here</a>.</p>\r\n<p>Then click the <strong>Contribute Now</strong> button to go to our easy-to-use online contribution form.</p>', 'Contribute Now', 1, 'contribute', 1, 1, 5000.00, 'USD', 1, 1, 1);
";
$this->_query($query);
}