Skip to content

Commit

Permalink
Merge pull request #16698 from eileenmcnaughton/note
Browse files Browse the repository at this point in the history
[NFC] Mark unused function deprecated, fix some comments & formatting
  • Loading branch information
seamuslee001 authored Mar 6, 2020
2 parents 40cbd64 + b37bd51 commit df70897
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CRM/Core/BAO/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
* @return string
* the note text or NULL if note not found
*
* @throws \CRM_Core_Exception
*
* @deprecated
*/
public static function getNoteText($id) {
CRM_Core_Error::deprecatedFunctionWarning('unused function');
return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'note');
}

Expand All @@ -49,6 +53,7 @@ public static function getNoteText($id) {
* @return string
* the note subject or NULL if note not found
*
* @throws \CRM_Core_Exception
*/
public static function getNoteSubject($id) {
return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'subject');
Expand All @@ -69,8 +74,8 @@ public static function getNotePrivacyHidden($note) {
return FALSE;
}

$noteValues = array();
if (is_object($note) && get_class($note) == 'CRM_Core_DAO_Note') {
$noteValues = [];
if (is_object($note) && get_class($note) === 'CRM_Core_DAO_Note') {
CRM_Core_DAO::storeValues($note, $noteValues);
}
else {
Expand Down Expand Up @@ -174,7 +179,7 @@ public static function add(&$params, $ids = array()) {
}
}

$recentOther = array();
$recentOther = [];
if ($noteActions) {
$recentOther = array(
'editUrl' => CRM_Utils_System::url('civicrm/contact/view/note',
Expand Down Expand Up @@ -229,8 +234,7 @@ public static function dataExists(&$params) {
* @param int $numNotes
* The maximum number of notes to return (0 if all).
*
* @return object
* $notes Object of CRM_Core_BAO_Note
* @return array
*/
public static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) {
if (empty($params)) {
Expand All @@ -248,10 +252,10 @@ public static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTE
$note->limit($numNotes);
$note->find();

$notes = array();
$notes = [];
$count = 0;
while ($note->fetch()) {
$values['note'][$note->id] = array();
$values['note'][$note->id] = [];
CRM_Core_DAO::storeValues($note, $values['note'][$note->id]);
$notes[] = $note;

Expand Down

0 comments on commit df70897

Please sign in to comment.