INFRA-132 - Comment grammar cleanup
[civicrm-core.git] / CRM / Core / BAO / Note.php
index c0cc0ddb9098f12ddd3f12f87e8ccadf4f3d1217..84f8aa61b60e71fe6edf8979dc9dc10d92f2cf51 100644 (file)
@@ -42,47 +42,47 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * Const the max number of notes we display at any given time
    * @var int
    */
-  CONST MAX_NOTES = 3;
+  const MAX_NOTES = 3;
 
   /**
    * Given a note id, retrieve the note text
    *
-   * @param int  $id   id of the note to retrieve
+   * @param int $id
+   *   Id of the note to retrieve.
    *
-   * @return string   the note text or null if note not found
+   * @return string   the note text or NULL if note not found
    *
-   * @access public
    * @static
    */
-  static function getNoteText($id) {
+  public static function getNoteText($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'note');
   }
 
   /**
    * Given a note id, retrieve the note subject
    *
-   * @param int  $id   id of the note to retrieve
+   * @param int $id
+   *   Id of the note to retrieve.
    *
-   * @return string   the note subject or null if note not found
+   * @return string   the note subject or NULL if note not found
    *
-   * @access public
    * @static
    */
-  static function getNoteSubject($id) {
+  public static function getNoteSubject($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'subject');
   }
 
   /**
    * 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
+   * @param object $note
+   *   Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself.
    *
    * @return boolean TRUE if the note should be displayed, otherwise FALSE
    *
-   * @access public
    * @static
    */
-  static function getNotePrivacyHidden($note) {
+  public static function getNotePrivacyHidden($note) {
     if (CRM_Core_Permission::check('view all notes')) {
       return FALSE;
     }
@@ -131,14 +131,15 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * note object. the params array could contain additional unused name/value
    * pairs
    *
-   * @param array $params  (reference) an assoc array of name/value pairs
-   * @param array $ids (deprecated) associated array with note id - preferably set $params['id']
+   * @param array $params
+   *   (reference) an assoc array of name/value pairs.
+   * @param array $ids
+   *   (deprecated) associated array with note id - preferably set $params['id'].
    *
    * @return object $note CRM_Core_BAO_Note object
-   * @access public
    * @static
    */
-  static function &add(&$params, $ids = array()) {
+  public static function &add(&$params, $ids = array()) {
     $dataExists = self::dataExists($params);
     if (!$dataExists) {
       return CRM_Core_DAO::$_nullObject;
@@ -219,13 +220,13 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   /**
    * Check if there is data to create the object
    *
-   * @param array  $params         (reference ) an assoc array of name/value pairs
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
    *
    * @return boolean
-   * @access public
    * @static
    */
-  static function dataExists(&$params) {
+  public static function dataExists(&$params) {
     // return if no data present
     if (!strlen($params['note'])) {
       return FALSE;
@@ -237,15 +238,17 @@ 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 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
    * @static
    */
-  static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) {
+  public static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) {
     if (empty($params)) {
       return NULL;
     }
@@ -281,13 +284,16 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   /**
    * Delete the notes
    *
-   * @param int $id note id
-   * @param boolean $showStatus do we need to set status or not
+   * @param int $id
+   *   Note id.
+   * @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
+   * @return mixed|NULL $return no of deleted notes on success, FALSE otherwise
+   * @access public
    * @static
    */
-  static function del($id, $showStatus = TRUE) {
+  public static function del($id, $showStatus = TRUE) {
     $return   = NULL;
     $recent   = array($id);
     $note     = new CRM_Core_DAO_Note();
@@ -330,11 +336,11 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   /**
    * Delete all records for this contact id
    *
-   * @param int  $id ID of the contact for which note needs to be deleted.
+   * @param int $id
+   *   ID of the contact for which note needs to be deleted.
    *
    * @return void
    *
-   * @access public
    * @static
    */
   public static function deleteContact($id) {
@@ -353,13 +359,13 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
   /**
    * 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
    *
-   * @access public
    * @static
    */
   public static function &getNote($id, $entityTable = 'civicrm_relationship') {
@@ -391,10 +397,9 @@ ORDER BY  modified_date desc";
    *
    * @return int $count count of log records
    *
-   * @access public
    * @static
    */
-  static function getContactNoteCount($contactID) {
+  public static function getContactNoteCount($contactID) {
     $note               = new CRM_Core_DAO_Note();
     $note->entity_id    = $contactID;
     $note->entity_table = 'civicrm_contact';
@@ -411,14 +416,16 @@ ORDER BY  modified_date desc";
   /**
    * 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.
-   * @param bool $snippet If TRUE, returned values will be pre-formatted for display in a table of notes.
+   * @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.
+   * @param bool $snippet
+   *   If TRUE, returned values will be pre-formatted for display in a table of notes.
    *
    * @return array Nested associative array beginning with direct children of given note.
    *
    * @static
-   * @access public
    */
   public static function getNoteTree($parentId, $maxDepth = 0, $snippet = FALSE) {
     return self::buildNoteTree($parentId, $maxDepth, $snippet);
@@ -427,12 +434,12 @@ ORDER BY  modified_date desc";
   /**
    * Get total count of direct children visible to the current user
    *
-   * @param int $id Note ID
+   * @param int $id
+   *   Note ID.
    *
    * @return int $count Number of notes having the give note as parent
    *
    * @static
-   * @access public
    */
   public static function getChildCount($id) {
     $note               = new CRM_Core_DAO_Note();
@@ -451,18 +458,23 @@ ORDER BY  modified_date desc";
   /**
    * Recursive function to 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.
-   * @param bool $snippet If TRUE, returned values will be pre-formatted for display in a table of notes.
-   * @param array $tree (Reference) Variable to store all found descendents
-   * @param int $depth Depth of current iteration within the descendent tree (used for comparison against maxDepth)
+   * @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.
+   * @param bool $snippet
+   *   If TRUE, returned values will be pre-formatted for display in a table of notes.
+   * @param array $tree
+   *   (Reference) Variable to store all found descendents.
+   * @param int $depth
+   *   Depth of current iteration within the descendent tree (used for comparison against maxDepth).
    *
    * @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) {
-      return false;
+      return FALSE;
     }
 
     // get direct children of given parentId note
@@ -516,8 +528,10 @@ ORDER BY  modified_date desc";
   /**
    * 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
+   * @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
    */
@@ -538,12 +552,13 @@ ORDER BY  modified_date desc";
   /**
    * Delete all note related to contact when contact is deleted
    *
-   * @param int $contactID contact id whose notes to be deleted
+   * @param int $contactID
+   *   Contact id whose notes to be deleted.
    *
    * @return void
    * @static
    */
-  static function cleanContactNotes($contactID) {
+  public static function cleanContactNotes($contactID) {
     $params = array(1 => array($contactID, 'Integer'));
 
     // delete all notes related to contribution
@@ -569,4 +584,3 @@ WHERE participant.contact_id = %1 AND  note.entity_table = 'civicrm_participant'
     }
   }
 }
-