Cleanup phpdoc comments
[civicrm-core.git] / CRM / Core / BAO / Note.php
index 091afa1c0c1fa0bf58d6b49b64a9dd80668afc27..c7e38201426e1c677e97e2f4ee498210de723ad9 100644 (file)
 class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
 
   /**
-   * const the max number of notes we display at any given time
+   * Const the max number of notes we display at any given time
    * @var int
    */
   CONST MAX_NOTES = 3;
 
   /**
-   * given a note id, retrieve the note text
+   * Given a note id, retrieve the note text
    *
    * @param int  $id   id of the note to retrieve
    *
@@ -59,7 +59,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * given a note id, retrieve the note subject
+   * Given a note id, retrieve the note subject
    *
    * @param int  $id   id of the note to retrieve
    *
@@ -73,7 +73,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * given a note id, decide if the note should be displayed based on privacy setting
+   * Given a note id, decide if the note should be displayed based on privacy setting
    *
    * @param object  $note Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself
    *
@@ -125,7 +125,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * takes an associative array and creates a note object
+   * 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
@@ -237,10 +237,9 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * Given the list of params in the params array, fetch the object
    * and store the values in the values array
    *
-   * @param array $params        input parameters to find object
-   * @param array $values        output values of the object
-   * @param array $ids           the array that holds all the db ids
-   * @param int   $numNotes      the maximum number of notes to return (0 if all)
+   * @param array $params input parameters to find object
+   * @param array $values output values of the object
+   * @param int $numNotes the maximum number of notes to return (0 if all)
    *
    * @return object $notes  Object of CRM_Core_BAO_Note
    * @access public
@@ -280,14 +279,12 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * Function to delete the notes
+   * Delete the notes
    *
-   * @param int $id  note id
+   * @param int $id note id
    * @param boolean $showStatus do we need to set status or not
    *
-   * @return $return no of deleted notes on success, false otherwise
-   *
-   * @access public
+   * @return mixed|null $return no of deleted notes on success, false otherwise@access public
    * @static
    */
   static function del($id, $showStatus = TRUE) {
@@ -331,7 +328,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * delete all records for this contact id
+   * Delete all records for this contact id
    *
    * @param int  $id ID of the contact for which note needs to be deleted.
    *
@@ -354,9 +351,11 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   }
 
   /**
-   * retrieve all records for this entity-id
+   * Retrieve all records for this entity-id
+   *
+   * @param int $id ID of the relationship for which records needs to be retrieved.
    *
-   * @param int  $id ID of the relationship for which records needs to be retrieved.
+   * @param string $entityTable
    *
    * @return array $viewNote array of note properties
    *
@@ -386,9 +385,9 @@ ORDER BY  modified_date desc";
   }
 
   /**
-   * Function to get log record count for a Contact
+   * Get log record count for a Contact
    *
-   * @param int $contactId Contact ID
+   * @param int $contactID
    *
    * @return int $count count of log records
    *
@@ -410,7 +409,7 @@ ORDER BY  modified_date desc";
   }
 
   /**
-   * Function to get all descendent notes of the note with given ID
+   * Get all descendent notes of the note with given ID
    *
    * @param int $parentId ID of the note to start from
    * @param int $maxDepth Maximum number of levels to descend into the tree; if not given, will include all descendents.
@@ -461,8 +460,7 @@ ORDER BY  modified_date desc";
    * @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) {
+  private static function buildNoteTree($parentId, $maxDepth = 0, $snippet = FALSE, &$tree = array(), $depth = 0) {
     if ($maxDepth && $depth > $maxDepth) {
       return false;
     }
@@ -490,7 +488,7 @@ ORDER BY  modified_date desc";
 
         // paper icon view for attachments part
         $paperIconAttachmentInfo = CRM_Core_BAO_File::paperIconAttachment('civicrm_note', $note->id);
-        $tree[$note->id]['attachment'] = implode('', $paperIconAttachmentInfo);
+        $tree[$note->id]['attachment'] = $paperIconAttachmentInfo ? implode('', $paperIconAttachmentInfo) : '';
 
         if ($snippet) {
           $tree[$note->id]['note'] = nl2br($tree[$note->id]['note']);
@@ -516,15 +514,14 @@ ORDER BY  modified_date desc";
   }
 
   /**
-   * given a note id, get a list of the ids of all notes that are descendents of that note
+   * 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 $ids One-dimensional array containing ids of all desendent notes
    */
-  public static function getDescendentIds($parentId, &$ids = array(
-    )) {
+  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';
@@ -539,10 +536,9 @@ ORDER BY  modified_date desc";
   }
 
   /**
-   * function to delete all note related to contact when contact is deleted
+   * Delete all note related to contact when contact is deleted
    *
    * @param int $contactID contact id whose notes to be deleted
-   * @param array $deleteNoteID to store all deleted note ids
    *
    * @return void
    * @static