msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

object return instead of array when call getMeetingTimeSuggestions under MeetingTimeSuggestionResult

Open jp-Telus opened this issue 4 years ago • 2 comments

I called the FindMeetingTime API ( /me/findMeetingTimes ) and got the list of suggestion result returned,

Here is the code:

    $findMeetingEventsUrl = '/me/findMeetingTimes';
    $results = $graph->createRequest('POST', $findMeetingEventsUrl)
        ->addHeaders(['Prefer'=> 'outlook.timezone="Pacific Standard Time"'])
        ->attachBody($newEvent)
        ->setReturnType(Model\MeetingTimeSuggestionsResult::class)
        ->execute();

When I call the getMeetingTimeSuggestions, I only get get an 'object' ("MeetingTimeSuggtesions") instead of array of "MeetingTimeSuggtesions". I expect to get the collections from this call. Do I miss something? Thank you.

   Error
   Cannot use object of type Microsoft\Graph\Model\MeetingTimeSuggestion as array

Source: https://github.com/microsoftgraph/msgraph-sdk-php/blob/dev/src/Model/MeetingTimeSuggestionsResult.php

AB#10302

jp-Telus avatar Jul 20 '21 15:07 jp-Telus

Hello @jp-Telus, thanks for reporting the issue and sorry for the inconveniencies caused. There is a fix which ready for this on MSGraph-SDK-Code-Generator. Once this is merged, I will update this issue.

SilasKenneth avatar Jul 21 '21 06:07 SilasKenneth

Related to #76 #97

SilasKenneth avatar Jul 21 '21 07:07 SilasKenneth