Elcodi\Admin\UserBundle\Controller\AdminUserController::isSameUser PHP Method

isSameUser() protected method

Check if the user is the same as the logged one
protected isSameUser ( Elcodi\Component\User\Entity\Interfaces\AdminUserInterface $entity ) : boolean
$entity Elcodi\Component\User\Entity\Interfaces\AdminUserInterface
return boolean
    protected function isSameUser(AdminUserInterface $entity)
    {
        /**
         * @var AdminUserInterface $user
         */
        $user = $this->getUser();
        return $entity->getId() == $user->getId();
    }