Merge pull request #21945 from masetto/profile-data-attribute
[civicrm-core.git] / CRM / Utils / Recent.php
index 64636385199d5823f834027febf1c17d49d119fe..aed16f4132f9efa9b9b2ed69dddcf3f70343ea6c 100644 (file)
@@ -24,7 +24,14 @@ class CRM_Utils_Recent {
    *
    * @var string
    */
-  const MAX_ITEMS = 30, STORE_NAME = 'CRM_Utils_Recent';
+  const STORE_NAME = 'CRM_Utils_Recent';
+
+  /**
+   * Max number of recent items to store
+   *
+   * @var int
+   */
+  const MAX_ITEMS = 30;
 
   /**
    * The list of recently viewed items.
@@ -76,7 +83,7 @@ class CRM_Utils_Recent {
    *   The link for the above title.
    * @param string $id
    *   Object id.
-   * @param $type
+   * @param string $type
    * @param int $contactId
    * @param string $contactName
    * @param array $others
@@ -152,11 +159,11 @@ class CRM_Utils_Recent {
 
     self::$_recent = array_filter(self::$_recent, function($item) use ($props) {
       foreach ($props as $key => $val) {
-        if (isset($item[$key]) && $item[$key] == $val) {
-          return FALSE;
+        if (isset($item[$key]) && $item[$key] != $val) {
+          return TRUE;
         }
       }
-      return TRUE;
+      return FALSE;
     });
   }