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


PHP CRM_Core_BAO_Email::dataExists方法代碼示例

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


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

示例1: add

 /**
  * takes an associative array and creates a contact object
  *
  * the function extract all the params it needs to initialize the create a
  * contact object. the params array could contain additional unused name/value
  * pairs
  *
  * @param array  $params         (reference ) an assoc array of name/value pairs
  * @param array  $ids            the array that holds all the db ids
  * @param int    $locationId
  * @param int    $emailId
  * @param bool   $isPrimary      Has any previous entry been marked as isPrimary?
  *
  * @return object    CRM_Core_BAO_Email object if successful 
  *                   else null will be returned
  * @access public
  * @static
  */
 function add(&$params, &$ids, $locationId, $emailId, &$isPrimary)
 {
     // if no data and we are not updating an exisiting record
     if (!CRM_Core_BAO_Email::dataExists($params, $locationId, $emailId, $ids)) {
         return null;
     }
     $email =& new CRM_Core_DAO_Email();
     $email->id = CRM_Utils_Array::value($emailId, $ids['location'][$locationId]['email']);
     $email->email = $params['location'][$locationId]['email'][$emailId]['email'];
     if (empty($email->email)) {
         $email->delete();
         return null;
     }
     $email->location_id = $params['location'][$locationId]['id'];
     // set this object to be the value of isPrimary and make sure no one else can be isPrimary
     $email->is_primary = $isPrimary;
     $isPrimary = false;
     return $email->save();
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:37,代碼來源:Email.php

示例2: dataExists

 /**
  * Check if there is data to create the object
  *
  * @param array  $params         (reference ) an assoc array of name/value pairs
  * @param array  $locationId     
  * @param array  $ids            (reference ) the array that holds all the db ids
  *
  * @return boolean
  * @access public
  * @static
  */
 function dataExists(&$params, $locationId, &$ids)
 {
     if (CRM_Utils_Array::value('id', $ids['location'][$locationId])) {
         return true;
     }
     // return if no data present
     if (!array_key_exists('location', $params) || !array_key_exists($locationId, $params['location'])) {
         return false;
     }
     //if location name exits return true
     if (CRM_Utils_Array::value('name', $params['location'][$locationId])) {
         return true;
     }
     if (CRM_Core_BAO_Address::dataExists($params, $locationId, $ids)) {
         return true;
     }
     for ($i = 1; $i <= CRM_CONTACT_FORM_LOCATION_BLOCKS; $i++) {
         if (CRM_Core_BAO_Phone::dataExists($params, $locationId, $i, $ids) || CRM_Core_BAO_Email::dataExists($params, $locationId, $i, $ids) || CRM_Core_BAO_IM::dataExists($params, $locationId, $i, $ids)) {
             return true;
         }
     }
     return false;
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:34,代碼來源:Location.php


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