当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contact_BAO_ContactType::basicTypes方法代码示例

本文整理汇总了PHP中CRM_Contact_BAO_ContactType::basicTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_ContactType::basicTypes方法的具体用法?PHP CRM_Contact_BAO_ContactType::basicTypes怎么用?PHP CRM_Contact_BAO_ContactType::basicTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contact_BAO_ContactType的用法示例。


在下文中一共展示了CRM_Contact_BAO_ContactType::basicTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: filterVoterIds

 public function filterVoterIds()
 {
     //do the cleanup later on.
     if (!is_array($this->_contactIds)) {
         return;
     }
     $profileId = CRM_Campaign_BAO_Survey::getSurveyProfileId($this->_surveyId);
     if ($profileId) {
         $profileType = CRM_Core_BAO_UFField::getProfileType($profileId);
         if (in_array($profileType, CRM_Contact_BAO_ContactType::basicTypes())) {
             $voterIdCount = count($this->_contactIds);
             //create temporary table to store voter ids.
             $tempTableName = CRM_Core_DAO::createTempTableName('civicrm_survey_respondent');
             CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS {$tempTableName}");
             $query = "\n     CREATE TEMPORARY TABLE {$tempTableName} (\n            id int unsigned NOT NULL AUTO_INCREMENT,\n            survey_contact_id int unsigned NOT NULL,\n  PRIMARY KEY ( id )\n);\n";
             CRM_Core_DAO::executeQuery($query);
             $batch = 100;
             $insertedCount = 0;
             do {
                 $processIds = $this->_contactIds;
                 $insertIds = array_splice($processIds, $insertedCount, $batch);
                 if (!empty($insertIds)) {
                     $insertSQL = "INSERT IGNORE INTO {$tempTableName}( survey_contact_id )\n                     VALUES (" . implode('),(', $insertIds) . ');';
                     CRM_Core_DAO::executeQuery($insertSQL);
                 }
                 $insertedCount += $batch;
             } while ($insertedCount < $voterIdCount);
             $query = "\n    SELECT  contact.id as id\n      FROM  civicrm_contact contact\nINNER JOIN  {$tempTableName} ON ( {$tempTableName}.survey_contact_id = contact.id )\n     WHERE  contact.contact_type != %1";
             $removeContact = CRM_Core_DAO::executeQuery($query, array(1 => array($profileType, 'String')));
             while ($removeContact->fetch()) {
                 unset($this->_contactIds[$removeContact->id]);
             }
         }
     }
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:35,代码来源:Interview.php

示例2: surveyProfileTypes

 /**
  * Get survey supportable profile types.
  */
 public static function surveyProfileTypes()
 {
     static $profileTypes;
     if (!isset($profileTypes)) {
         $profileTypes = array_merge(array('Activity', 'Contact'), CRM_Contact_BAO_ContactType::basicTypes());
         $profileTypes = array_diff($profileTypes, array('Organization', 'Household'));
     }
     return $profileTypes;
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:12,代码来源:Survey.php

示例3: surveyProfileTypes

 /**
  * Function to get survey supportable profile types
  *
  */
 public static function surveyProfileTypes()
 {
     static $profileTypes;
     if (!isset($profileTypes)) {
         $profileTypes = array_merge(array('Activity', 'Contact'), CRM_Contact_BAO_ContactType::basicTypes());
     }
     return $profileTypes;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:12,代码来源:Survey.php


注:本文中的CRM_Contact_BAO_ContactType::basicTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。