private function createUser($login, $password, $email)
    {
        $encoderFactory = $this->bbapp->getContainer()->get('security.context')->getEncoderFactory();

        $adminUser = new \BackBee\Security\User(
            $login,
            $password,
            'SuperAdmin',
            'SuperAdmin'
        );

        $adminUser
            ->setApiKeyEnabled(true)
            ->setActivated(true)
        ;

        $encoder = $encoderFactory->getEncoder($adminUser);
        $adminUser
            ->setPassword($encoder->encodePassword($password, ''))
            ->setEmail($email)
            ->generateRandomApiKey()
        ;

        $this->entyMgr->persist($adminUser);
        $this->entyMgr->flush($adminUser);

        return $adminUser;
    }
private function createUser($login, $password, $email)
    {
        $encoderFactory = $this->bbapp->getContainer()->get('security.context')->getEncoderFactory();

        $adminUser = new \BackBee\Security\User(
            $login,
            $password,
            'SuperAdmin',
            'SuperAdmin'
        );

        $adminUser
            ->setApiKeyEnabled(true)
            ->setActivated(true)
        ;

        $encoder = $encoderFactory->getEncoder($adminUser);
        $adminUser
            ->setPassword($encoder->encodePassword($password, ''))
            ->setEmail($email)
            ->generateRandomApiKey()
        ;

        $this->entyMgr->persist($adminUser);
        $this->entyMgr->flush($adminUser);

        return $adminUser;
    }
private function createUser ( $ login , $ password , $ email ) { $ encoderFactory = $ this -> bbapp -> getContainer ( ) -> get ( 'security.context' ) -> getEncoderFactory ( ) ; $ adminUser = new \ BackBee \ Security \ User ( $ login , $ password , 'SuperAdmin' , 'SuperAdmin' ) ; $ adminUser -> setApiKeyEnabled ( true ) -> setActivated ( true ) ; $ encoder = $ encoderFactory -> getEncoder ( $ adminUser ) ; $ adminUser -> setPassword ( $ encoder -> encodePassword ( $ password , '' ) ) -> setEmail ( $ email ) -> generateRandomApiKey ( ) ; $ this -> entyMgr -> persist ( $ adminUser ) ; $ this -> entyMgr -> flush ( $ adminUser ) ; return $ adminUser ; }
Create new superadmin user

@param  string   $login         User name
@param  string   $password      User password
@param  string   $email         User email

@return \BackBee\Security\User   The user object
Create new superadmin user