本文整理汇总了PHP中CRM_Core_BAO_Note::dataExists方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Note::dataExists方法的具体用法?PHP CRM_Core_BAO_Note::dataExists怎么用?PHP CRM_Core_BAO_Note::dataExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Note
的用法示例。
在下文中一共展示了CRM_Core_BAO_Note::dataExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
/**
* takes an associative array and creates a note object
*
* the function extract all the params it needs to initialize the create a
* note object. the params array could contain additional unused name/value
* pairs
*
* @param array $params (reference ) an assoc array of name/value pairs
*
* @return object CRM_Core_BAO_Note object
* @access public
* @static
*/
function &add(&$params)
{
$dataExists = CRM_Core_BAO_Note::dataExists($params);
if (!$dataExists) {
return null;
}
$note =& new CRM_Core_BAO_Note();
$params['modified_date'] = date("Ymd");
$params['entity_id'] = $params['entity_id'];
$params['entity_table'] = $params['entity_table'];
$note->copyValues($params);
$session =& CRM_Core_Session::singleton();
$note->contact_id = $session->get('userID');
if (!$note->contact_id) {
if ($params['entity_table'] == 'civicrm_contact') {
$note->contact_id = $params['entity_id'];
} else {
CRM_Utils_System::statusBounce(ts('We could not find your logged in user ID'));
}
}
$note->save();
return $note;
}