getUser() public method

Get user.
public getUser ( ) : FOS\UserBundle\Model\UserInterface
return FOS\UserBundle\Model\UserInterface $user
 /**
  * Checks that the current logged in user has access to given invoice
  *
  * @param CustomerInterface $customer The linked customer
  *
  * @throws AccessDeniedException
  */
 protected function checkAccess(CustomerInterface $customer)
 {
     if (!($user = $this->getUser()) || !$customer->getUser() || $customer->getUser()->getId() !== $user->getId()) {
         throw new AccessDeniedException();
     }
 }