CRM-19372 allow payment processors to define an array of accepted credit card types
[civicrm-core.git] / CRM / Core / Session.php
index 8919654be315bbe2b34f786f8feb2bedd5240e08..0cc415529084e4fc1fcfdd797e68a49fb6a2ba8b 100644 (file)
@@ -546,6 +546,21 @@ class CRM_Core_Session {
     return $session->get('userID');
   }
 
+  /**
+   * Get display name of the logged in user.
+   *
+   * @return string
+   *
+   * @throws CiviCRM_API3_Exception
+   */
+  public function getLoggedInContactDisplayName() {
+    $userContactID = CRM_Core_Session::singleton()->getLoggedInContactID();
+    if (!$userContactID) {
+      return '';
+    }
+    return civicrm_api3('Contact', 'getvalue', array('id' => $userContactID, 'return' => 'display_name'));
+  }
+
   /**
    * Check if session is empty.
    *