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


PHP CRM_Core_DAO_Note::fetch方法代碼示例

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


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

示例1: getDescendentIds

 /**
  * Given a note id, get a list of the ids of all notes that are descendents of that note
  *
  * @param int $parentId
  *   Id of the given note.
  * @param array $ids
  *   (reference) one-dimensional array to store found descendent ids.
  *
  * @return array
  *   One-dimensional array containing ids of all desendent notes
  */
 public static function getDescendentIds($parentId, &$ids = array())
 {
     // get direct children of given parentId note
     $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_note';
     $note->entity_id = $parentId;
     $note->find();
     while ($note->fetch()) {
         // foreach child, add to ids list, and recurse
         $ids[] = $note->id;
         self::getDescendentIds($note->id, $ids);
     }
     return $ids;
 }
開發者ID:konadave,項目名稱:civicrm-core,代碼行數:25,代碼來源:Note.php

示例2: 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);
 }
開發者ID:hguru,項目名稱:224Civi,代碼行數:42,代碼來源:Note.php


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