当前位置: 首页>>代码示例>>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;未经允许,请勿转载。