public function update(User $user, $flush = true)
    {
        $this->objectManager->persist($user);

        if ($flush) {
            $this->objectManager->flush();
        }
    }
public function update(User $user, $flush = true)
    {
        $this->objectManager->persist($user);

        if ($flush) {
            $this->objectManager->flush();
        }
    }
public function update ( User $ user , $ flush = true ) { $ this -> objectManager -> persist ( $ user ) ; if ( $ flush ) { $ this -> objectManager -> flush ( ) ; } }
Updates an user.

@param User $user
@param bool $flush
Updates an user .