public function blockUser(UserInterface $user, $expire, $reason, $creator = null)
    {
        $class = $this->entityOptions->getUserBlock();
        /** @var UserBlockEntity $userBlock */
        $userBlock = new $class;
        $userBlock->setUser($user);
        $userBlock->setCreator($creator);
        $userBlock->setReason($reason);
        $userBlock->setExpire($expire);

        $this->blockUserWithEntity($userBlock);
    }
public function blockUser(UserInterface $user, $expire, $reason, $creator = null)
    {
        $class = $this->entityOptions->getUserBlock();
        /** @var UserBlockEntity $userBlock */
        $userBlock = new $class;
        $userBlock->setUser($user);
        $userBlock->setCreator($creator);
        $userBlock->setReason($reason);
        $userBlock->setExpire($expire);

        $this->blockUserWithEntity($userBlock);
    }
public function blockUser ( UserInterface $ user , $ expire , $ reason , $ creator = null ) { $ class = $ this -> entityOptions -> getUserBlock ( ) ; /** @var UserBlockEntity $userBlock */ $ userBlock = new $ class ; $ userBlock -> setUser ( $ user ) ; $ userBlock -> setCreator ( $ creator ) ; $ userBlock -> setReason ( $ reason ) ; $ userBlock -> setExpire ( $ expire ) ; $ this -> blockUserWithEntity ( $ userBlock ) ; }
We want to block a user

@param UserInterface $user
@param $expire
@param $reason
@param null|UserInterface $creator
We want to block a user