public function createGuestSessionToken(array $data = [])
    {
        $token = new GuestSessionToken();

        if (array_key_exists('expires_at', $data)) {
            $token->setExpiresAt(new \DateTime($data['expires_at']));
        }

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

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

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

        if (array_key_exists('expires_at', $data)) {
            $token->setExpiresAt(new \DateTime($data['expires_at']));
        }

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

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

        return $token;
    }
public function createGuestSessionToken ( array $ data = [ ] ) { $ token = new GuestSessionToken ( ) ; if ( array_key_exists ( 'expires_at' , $ data ) ) { $ token -> setExpiresAt ( new \ DateTime ( $ data [ 'expires_at' ] ) ) ; } if ( array_key_exists ( 'guest_session_id' , $ data ) ) { $ token -> setToken ( $ data [ 'guest_session_id' ] ) ; } if ( array_key_exists ( 'success' , $ data ) ) { $ token -> setSuccess ( $ data [ 'success' ] ) ; } return $ token ; }
Create session token for guest

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