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


PHP CRM_Case_BAO_Case::find方法代码示例

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


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

示例1:

 /**
  * Given the list of params in the params array, fetch the object
  * and store the values in the values array
  *
  * @param array $params input parameters to find object
  * @param array $values output values of the object
  * @param array $ids    the array that holds all the db ids
  *
  * @return CRM_Case_BAO_Case|null the found object or null
  * @access public
  * @static
  */
 static function &getValues(&$params, &$values, &$ids)
 {
     $case = new CRM_Case_BAO_Case();
     $case->copyValues($params);
     if ($case->find(TRUE)) {
         $ids['case'] = $case->id;
         CRM_Core_DAO::storeValues($case, $values);
         return $case;
     }
     return NULL;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:23,代码来源:Case.php

示例2: _civicrm_api3_case_read

/**
 * Internal function to retrieve a case.
 *
 * @param int $caseId
 *
 * @return array (reference) case object
 *
 */
function _civicrm_api3_case_read($caseId, $options)
{
    $return = CRM_Utils_Array::value('return', $options, array());
    $dao = new CRM_Case_BAO_Case();
    $dao->id = $caseId;
    if ($dao->find(TRUE)) {
        $case = array();
        _civicrm_api3_object_to_array($dao, $case);
        // Legacy support for client_id - TODO: in apiv4 remove 'client_id'
        $case['client_id'] = $case['contact_id'] = $dao->retrieveContactIdsByCaseId($caseId);
        //handle multi-value case type
        $sep = CRM_Core_DAO::VALUE_SEPARATOR;
        $case['case_type_id'] = trim(str_replace($sep, ',', $case['case_type_id']), ',');
        if (!empty($return['contacts'])) {
            //get case contacts
            $contacts = CRM_Case_BAO_Case::getcontactNames($caseId);
            $relations = CRM_Case_BAO_Case::getRelatedContacts($caseId);
            $case['contacts'] = array_merge($contacts, $relations);
        }
        if (!empty($return['activities'])) {
            //get case activities
            $case['activities'] = array();
            $query = "SELECT activity_id FROM civicrm_case_activity WHERE case_id = {$caseId}";
            $dao = CRM_Core_DAO::executeQuery($query);
            while ($dao->fetch()) {
                $case['activities'][] = $dao->activity_id;
            }
        }
        return $case;
    }
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:39,代码来源:Case.php

示例3: _civicrm_api3_case_read

/**
 * Internal function to retrieve a case.
 *
 * @param int $caseId
 *
 * @return array (reference) case object
 *
 */
function _civicrm_api3_case_read($caseId)
{
    $dao = new CRM_Case_BAO_Case();
    $dao->id = $caseId;
    if ($dao->find(TRUE)) {
        $case = array();
        _civicrm_api3_object_to_array($dao, $case);
        $case['client_id'] = $dao->retrieveContactIdsByCaseId($caseId);
        //handle multi-value case type
        $sep = CRM_Core_DAO::VALUE_SEPARATOR;
        $case['case_type_id'] = trim(str_replace($sep, ',', $case['case_type_id']), ',');
        return $case;
    } else {
        return FALSE;
    }
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:Case.php

示例4: _civicrm_api3_case_read

/**
 * Internal function to retrieve a case.
 *
 * @param int $caseId
 *
 * @param array $options
 *
 * @param bool $checkPermission
 *
 * @return array
 *   case object
 */
function _civicrm_api3_case_read($caseId, $options, $checkPermission)
{
    $return = CRM_Utils_Array::value('return', $options, array());
    $dao = new CRM_Case_BAO_Case();
    $dao->id = $caseId;
    if ($dao->find(TRUE)) {
        $case = array();
        _civicrm_api3_object_to_array($dao, $case);
        _civicrm_api3_custom_data_get($case, $checkPermission, 'Case', $caseId);
        // Legacy support for client_id - TODO: in apiv4 remove 'client_id'
        $case['client_id'] = $case['contact_id'] = $dao->retrieveContactIdsByCaseId($caseId);
        if (!empty($return['contacts'])) {
            //get case contacts
            $contacts = CRM_Case_BAO_Case::getcontactNames($caseId);
            $relations = CRM_Case_BAO_Case::getRelatedContacts($caseId);
            $case['contacts'] = array_merge($contacts, $relations);
        }
        if (!empty($return['activities'])) {
            //get case activities
            $case['activities'] = array();
            $query = "SELECT activity_id FROM civicrm_case_activity WHERE case_id = {$caseId}";
            $dao = CRM_Core_DAO::executeQuery($query);
            while ($dao->fetch()) {
                $case['activities'][] = $dao->activity_id;
            }
        }
        return $case;
    }
}
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:41,代码来源:Case.php

示例5: _civicrm_case_read

/**
 * Internal function to retrieve a case.
 *
 * @param int $caseId
 *
 * @return array (reference) case object
 *
 */
function _civicrm_case_read($caseId)
{
    $dao = new CRM_Case_BAO_Case();
    $dao->id = $caseId;
    if ($dao->find(true)) {
        $case = array();
        _civicrm_object_to_array($dao, $case);
        //handle multi-value case type
        $sep = CRM_Case_BAO_Case::VALUE_SEPERATOR;
        $case['case_type_id'] = trim(str_replace($sep, ',', $case['case_type_id']), ',');
        return $case;
    } else {
        return false;
    }
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:23,代码来源:Case.php


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