public function installUsers()
    {
        $this->_userService = new erdiko\users\models\User();

        $results = array(
            "successes" => array(),
            "failures"  => array(),
        );

        foreach($this->_usersArray as $user) {

            // get role ID from the name
            $user["role"] = $this->_getRole($user["role"])->getId();

            // create the user
            $createResult = (boolean)$this->_userService->createUser($user);

            unset($user["password"]);

            if(true !== $createResult) {
                $results["failures"][] = $user;
            } else {
                $results["successes"][] = $user;
            }
        }

        return $results;
    }
public function installUsers()
    {
        $this->_userService = new erdiko\users\models\User();

        $results = array(
            "successes" => array(),
            "failures"  => array(),
        );

        foreach($this->_usersArray as $user) {

            // get role ID from the name
            $user["role"] = $this->_getRole($user["role"])->getId();

            // create the user
            $createResult = (boolean)$this->_userService->createUser($user);

            unset($user["password"]);

            if(true !== $createResult) {
                $results["failures"][] = $user;
            } else {
                $results["successes"][] = $user;
            }
        }

        return $results;
    }
public function installUsers ( ) { $ this -> _userService = new erdiko \ users \ models \ User ( ) ; $ results = array ( "successes" => array ( ) , "failures" => array ( ) , ) ; foreach ( $ this -> _usersArray as $ user ) { // get role ID from the name $ user [ "role" ] = $ this -> _getRole ( $ user [ "role" ] ) -> getId ( ) ; // create the user $ createResult = ( boolean ) $ this -> _userService -> createUser ( $ user ) ; unset ( $ user [ "password" ] ) ; if ( true !== $ createResult ) { $ results [ "failures" ] [ ] = $ user ; } else { $ results [ "successes" ] [ ] = $ user ; } } return $ results ; }
loop through the users array and create records
loop through the users array and create records