public function createSessionToken(array $data = [])
    {
        $token = new SessionToken();

        if (array_key_exists('session_id', $data)) {
            $token->setToken($data['session_id']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
public function createSessionToken(array $data = [])
    {
        $token = new SessionToken();

        if (array_key_exists('session_id', $data)) {
            $token->setToken($data['session_id']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
public function createSessionToken ( array $ data = [ ] ) { $ token = new SessionToken ( ) ; if ( array_key_exists ( 'session_id' , $ data ) ) { $ token -> setToken ( $ data [ 'session_id' ] ) ; } if ( array_key_exists ( 'success' , $ data ) ) { $ token -> setSuccess ( $ data [ 'success' ] ) ; } return $ token ; }
Create session token for user

@param  array        $data
@return SessionToken
Create session token for user