| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @return string
* the note text or NULL if note not found
*
- * @static
*/
public static function getNoteText($id) {
return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'note');
* @return string
* the note subject or NULL if note not found
*
- * @static
*/
public static function getNoteSubject($id) {
return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'subject');
* @param object $note
* Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself.
*
- * @return boolean
+ * @return bool
* TRUE if the note should be displayed, otherwise FALSE
*
- * @static
*/
public static function getNotePrivacyHidden($note) {
if (CRM_Core_Permission::check('view all notes')) {
*
* @return object
* $note CRM_Core_BAO_Note object
- * @static
*/
public static function &add(&$params, $ids = array()) {
$dataExists = self::dataExists($params);
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return boolean
- * @static
+ * @return bool
*/
public static function dataExists(&$params) {
// return if no data present
*
* @return object
* $notes Object of CRM_Core_BAO_Note
- * @static
*/
public static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) {
if (empty($params)) {
return NULL;
}
- $note = new CRM_Core_BAO_Note();
- $note->entity_id = $params['contact_id'];
+ $note = new CRM_Core_BAO_Note();
+ $note->entity_id = $params['contact_id'];
$note->entity_table = 'civicrm_contact';
// get the total count of notes
* @param bool $showStatus
* Do we need to set status or not.
*
- * @return mixed|NULL $return no of deleted notes on success, FALSE otherwise
- * @access public
- * @static
+ * @return int|NULL
+ * no of deleted notes on success, null otherwise
*/
public static function del($id, $showStatus = TRUE) {
- $return = NULL;
- $recent = array($id);
- $note = new CRM_Core_DAO_Note();
+ $return = NULL;
+ $recent = array($id);
+ $note = new CRM_Core_DAO_Note();
$note->id = $id;
$note->find();
$note->fetch();
*
* @return void
*
- * @static
*/
public static function deleteContact($id) {
// need to delete for both entity_id
- $dao = new CRM_Core_DAO_Note();
+ $dao = new CRM_Core_DAO_Note();
$dao->entity_table = 'civicrm_contact';
- $dao->entity_id = $id;
+ $dao->entity_id = $id;
$dao->delete();
// and the creator contact id
* @return array
* array of note properties
*
- * @static
*/
public static function &getNote($id, $entityTable = 'civicrm_relationship') {
$viewNote = array();
* @return int
* $count count of log records
*
- * @static
*/
public static function getContactNoteCount($contactID) {
- $note = new CRM_Core_DAO_Note();
- $note->entity_id = $contactID;
+ $note = new CRM_Core_DAO_Note();
+ $note->entity_id = $contactID;
$note->entity_table = 'civicrm_contact';
$note->find();
$count = 0;
* @return array
* Nested associative array beginning with direct children of given note.
*
- * @static
*/
public static function getNoteTree($parentId, $maxDepth = 0, $snippet = FALSE) {
return self::buildNoteTree($parentId, $maxDepth, $snippet);
* @return int
* $count Number of notes having the give note as parent
*
- * @static
*/
public static function getChildCount($id) {
- $note = new CRM_Core_DAO_Note();
+ $note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_note';
- $note->entity_id = $id;
+ $note->entity_id = $id;
$note->find();
$count = 0;
while ($note->fetch()) {
*
* @return array
* Nested associative array beginning with direct children of given note.
- * @static
*/
private static function buildNoteTree($parentId, $maxDepth = 0, $snippet = FALSE, &$tree = array(), $depth = 0) {
if ($maxDepth && $depth > $maxDepth) {
}
// get direct children of given parentId note
- $note = new CRM_Core_DAO_Note();
+ $note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_note';
- $note->entity_id = $parentId;
+ $note->entity_id = $parentId;
$note->orderBy('modified_date asc');
$note->find();
while ($note->fetch()) {
CRM_Core_DAO::storeValues($note, $tree[$note->id]);
// get name of user that created this note
- $contact = new CRM_Contact_DAO_Contact();
+ $contact = new CRM_Contact_DAO_Contact();
$createdById = $note->contact_id;
$contact->id = $createdById;
$contact->find();
*/
public static function getDescendentIds($parentId, &$ids = array()) {
// get direct children of given parentId note
- $note = new CRM_Core_DAO_Note();
+ $note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_note';
- $note->entity_id = $parentId;
+ $note->entity_id = $parentId;
$note->find();
while ($note->fetch()) {
// foreach child, add to ids list, and recurse
* Contact id whose notes to be deleted.
*
* @return void
- * @static
*/
public static function cleanContactNotes($contactID) {
$params = array(1 => array($contactID, 'Integer'));
self::del($contactNoteId->id, FALSE);
}
}
+
}