Nette\Security\User::getIdentity PHP Метод

getIdentity() публичный Метод

Returns current user identity, if any.
public getIdentity ( ) : Nette\Security\IIdentity | null
Результат Nette\Security\IIdentity | null
    public function getIdentity()
    {
        return $this->storage->getIdentity();
    }

Usage Example

Пример #1
0
 public function onSuccessCommentRemoval(Comment $comment, $id)
 {
     /** @var \Users\User $user */
     $user = $this->user->getIdentity();
     $pageLink = $this->linkGenerator->link('Pages:Front:Page:show', ['internal_id' => $comment->getPageId()]);
     $this->appEventLogger->saveLog(sprintf('User [%s#%s] <b>has REMOVED</b> the Comment [%s#] of Author [%s] on the <a href="%s">Page [%s#%s]</a>', $user->getId(), $user->getUsername(), $id, $comment->getAuthor(), $pageLink, $comment->getPageId(), $comment->getPageTitle()), 'page_comment_release', $user->getId());
 }
All Usage Examples Of Nette\Security\User::getIdentity