當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Contact_DAO_Contact::selectAdd方法代碼示例

本文整理匯總了PHP中CRM_Contact_DAO_Contact::selectAdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contact_DAO_Contact::selectAdd方法的具體用法?PHP CRM_Contact_DAO_Contact::selectAdd怎麽用?PHP CRM_Contact_DAO_Contact::selectAdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Contact_DAO_Contact的用法示例。


在下文中一共展示了CRM_Contact_DAO_Contact::selectAdd方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addActivity

 /**
  * This method populates the civicrm_activity_history table
  */
 private function addActivity()
 {
     $contactDAO = new CRM_Contact_DAO_Contact();
     $contactDAO->contact_type = 'Individual';
     $contactDAO->selectAdd();
     $contactDAO->selectAdd('id');
     $contactDAO->orderBy('sort_name');
     $contactDAO->find();
     $count = 0;
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     while ($contactDAO->fetch()) {
         if ($count++ > 2) {
             break;
         }
         for ($i = 0; $i < self::NUM_ACTIVITY; $i++) {
             $activityDAO = new CRM_Activity_DAO_Activity();
             $activityId = CRM_Core_OptionGroup::values('activity_type', NULL, NULL, NULL, ' AND v.name IN ("Tell A Friend", "Pledge Acknowledgment")');
             $activityTypeID = array_rand($activityId);
             $activity = CRM_Core_PseudoConstant::activityType();
             $activityDAO->activity_type_id = $activityTypeID;
             $activityDAO->subject = "Subject for {$activity[$activityTypeID]}";
             $activityDAO->activity_date_time = $this->randomDate();
             $activityDAO->status_id = 2;
             $this->_insert($activityDAO);
             $activityContactDAO = new CRM_Activity_DAO_ActivityContact();
             $activityContactDAO->activity_id = $activityDAO->id;
             $activityContactDAO->contact_id = $contactDAO->id;
             $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Source', $activityContacts);
             $this->_insert($activityContactDAO);
             if ($activityTypeID == 9) {
                 $activityContactDAO = new CRM_Activity_DAO_ActivityContact();
                 $activityContactDAO->activity_id = $activityDAO->id;
                 $activityContactDAO->contact_id = mt_rand(1, 101);
                 $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Targets', $activityContacts);
                 $this->_insert($activityContactDAO);
             }
         }
     }
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:42,代碼來源:GenerateData.php

示例2: addActivity

 /**
  * This method populates the civicrm_activity_history table
  */
 private function addActivity()
 {
     $contactDAO = new CRM_Contact_DAO_Contact();
     $contactDAO->contact_type = 'Individual';
     $contactDAO->selectAdd();
     $contactDAO->selectAdd('id');
     $contactDAO->orderBy('sort_name');
     $contactDAO->find();
     $count = 0;
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     while ($contactDAO->fetch()) {
         if ($count++ > 2) {
             break;
         }
         for ($i = 0; $i < self::NUM_ACTIVITY; $i++) {
             $activityDAO = new CRM_Activity_DAO_Activity();
             $activityTypeID = mt_rand(7, 10);
             $activity = CRM_Core_PseudoConstant::activityType();
             $activityDAO->activity_type_id = $activityTypeID;
             $activityDAO->subject = "Subject for {$activity[$activityTypeID]}";
             $activityDAO->activity_date_time = $this->randomDate();
             $activityDAO->duration = mt_rand(1, 6);
             $activityDAO->status_id = 2;
             $this->_insert($activityDAO);
             $activityContactDAO = new CRM_Activity_DAO_ActivityContact();
             $activityContactDAO->activity_id = $activityDAO->id;
             $activityContactDAO->contact_id = $contactDAO->id;
             $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Source', $activityContacts);
             $this->_insert($activityContactDAO);
             if (in_array($activityTypeID, array(6, 9))) {
                 $activityContactDAO = new CRM_Activity_DAO_ActivityContact();
                 $activityContactDAO->activity_id = $activityDAO->id;
                 $activityContactDAO->contact_id = mt_rand(1, 101);
                 $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Targets', $activityContacts);
                 $this->_insert($activityContactDAO);
             }
             if ($activityTypeID == 7) {
                 $activityContactDAO = new CRM_Activity_DAO_ActivityContact();
                 $activityContactDAO->activity_id = $activityDAO->id;
                 $activityContactDAO->contact_id = mt_rand(1, 101);
                 $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
                 $this->_insert($activityContactDAO);
             }
         }
     }
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:49,代碼來源:GenerateData.php


注:本文中的CRM_Contact_DAO_Contact::selectAdd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。