public function registerUser(BaseUser $user, $source = self::SOURCE_TYPE_WEBSITE)
    {
        $user->setRoles(["ROLE_USER"])
            ->setSource($source)
            ->setEnabled(true);

        $this->saveUserWithPlainPassword($user);

        $this->dispatcher->dispatch(self::REGISTER_EVENT, new UserEvent($user));

        return $user;
    }
public function registerUser(BaseUser $user, $source = self::SOURCE_TYPE_WEBSITE)
    {
        $user->setRoles(["ROLE_USER"])
            ->setSource($source)
            ->setEnabled(true);

        $this->saveUserWithPlainPassword($user);

        $this->dispatcher->dispatch(self::REGISTER_EVENT, new UserEvent($user));

        return $user;
    }
public function registerUser ( BaseUser $ user , $ source = self :: SOURCE_TYPE_WEBSITE ) { $ user -> setRoles ( [ "ROLE_USER" ] ) -> setSource ( $ source ) -> setEnabled ( true ) ; $ this -> saveUserWithPlainPassword ( $ user ) ; $ this -> dispatcher -> dispatch ( self :: REGISTER_EVENT , new UserEvent ( $ user ) ) ; return $ user ; }
Saves a new user to our database

@param BaseUser $user
@param string $source

@return BaseUser
Saves a new user to our database