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