Commit 7fe11f56 authored by alexpott's avatar alexpott

Issue #2988432 by msankhala, gaurav.kapoor, ravi.shankar, vimal_nadar,...

Issue #2988432 by msankhala, gaurav.kapoor, ravi.shankar, vimal_nadar, joachim, vacho, Berdir, leanderl: Drupal::currentUser() should give sample code to get the current user entity

(cherry picked from commit c202dbde)
parent 28ae4e01
......@@ -251,6 +251,13 @@ public static function routeMatch() {
/**
* Gets the current active user.
*
* This method will return the \Drupal\Core\Session\AccountProxy object of the
* current user. You can use the \Drupal\user\Entity\User::load() method to
* load the full user entity object. For example:
* @code
* $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
* @endcode
*
* @return \Drupal\Core\Session\AccountProxyInterface
*/
public static function currentUser() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment