src/Services/UserService.php
/**
     * Method for removal of entity
     *
     * @param string $id ID of user entity
     *
     * @return string ID of user entity
     * @throws EntityNotFoundException
     */
Method for removal of entity
@param string $id ID of user entity

@return string ID of user entity
@throws EntityNotFoundException
Method for removal of entity @param string $id ID of user entity @return string ID of user entity @throws EntityNotFoundException
public function deleteUser(string $id)
    {
        $user = $this->repository->find($id);
        if ( $user === null ) {
            throw new EntityNotFoundException();
        }
        $this->entityManager->remove($user);
        $this->entityManager->flush($user);
        return $id;
    }
public function deleteUser ( string $ id ) { $ user = $ this -> repository -> find ( $ id ) ; if ( $ user === null ) { throw new EntityNotFoundException ( ) ; } $ this -> entityManager -> remove ( $ user ) ; $ this -> entityManager -> flush ( $ user ) ; return $ id ; }
Method for removal of entity
 @param string $id ID of user entity
Method for removal of entity @param string $id ID of user entity
/** @var User|null $user */