本文整理汇总了PHP中CRM_Core_BAO_Note::getChildCount方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Note::getChildCount方法的具体用法?PHP CRM_Core_BAO_Note::getChildCount怎么用?PHP CRM_Core_BAO_Note::getChildCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Note
的用法示例。
在下文中一共展示了CRM_Core_BAO_Note::getChildCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_contact';
$note->entity_id = $this->_contactId;
$note->orderBy('modified_date desc');
//CRM-4418, handling edit and delete separately.
$permissions = array($this->_permission);
if ($this->_permission == CRM_Core_Permission::EDIT) {
//previously delete was subset of edit
//so for consistency lets grant delete also.
$permissions[] = CRM_Core_Permission::DELETE;
}
$mask = CRM_Core_Action::mask($permissions);
$values = array();
$links = self::links();
$action = array_sum(array_keys($links)) & $mask;
$note->find();
while ($note->fetch()) {
if (!CRM_Core_BAO_Note::getNotePrivacyHidden($note)) {
CRM_Core_DAO::storeValues($note, $values[$note->id]);
$values[$note->id]['action'] = CRM_Core_Action::formLink($links, $action, array('id' => $note->id, 'cid' => $this->_contactId));
$contact = new CRM_Contact_DAO_Contact();
$contact->id = $note->contact_id;
$contact->find();
$contact->fetch();
$values[$note->id]['createdBy'] = $contact->display_name;
$values[$note->id]['comment_count'] = CRM_Core_BAO_Note::getChildCount($note->id);
}
}
$this->assign('notes', $values);
$commentLinks = self::commentLinks();
$action = array_sum(array_keys($commentLinks)) & $mask;
$commentAction = CRM_Core_Action::formLink($commentLinks, $action, array('id' => $note->id, 'pid' => $note->entity_id, 'cid' => $note->entity_id));
$this->assign('commentAction', $commentAction);
}