API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal.php/function/Drupa...
Getting the current user entity is a common enough task that this documentation should explain how to do it.
The code from this comment https://api.drupal.org/comment/63486#comment-63486 could be folded in.