I have a object with protected property that I want to get dateTime. 
1)modelData->start->dateTime //2017-05-10T17:00:00+05:30
2)modelData->end->dateTime //2017-05-10T17:20:00+05:30
The object looks like
Google_Service_Calendar_Event Object
(
    [collection_key:protected] => recurrence   
    [attachmentsType:protected] => Google_Service_Calendar_EventAttachment   
    [created] => 2017-05-08T07:05:43.000Z
    [creatorType:protected] => Google_Service_Calendar_EventCreator
    [creatorDataType:protected] => 
    [description] => 
    [endType:protected] => Google_Service_Calendar_EventDateTime
    [endDataType:protected] => 
    [endTimeUnspecified] => 
    [etag] => "2988454353000000"
    [extendedPropertiesType:protected] => Google_Service_Calendar_EventExtendedProperties
    [extendedPropertiesDataType:protected] => 
    [gadgetType:protected] => Google_Service_Calendar_EventGadget   
    [visibility] => 
    [internal_gapi_mappings:protected] => Array
        (
        )
    [modelData:protected] => Array
        (
            [creator] => Array
                (
                    [email] => pickzy.nettest@gmail.com
                    [self] => 1
                )
            [organizer] => Array
                (
                    [email] => pickzy.nettest@gmail.com
                    [self] => 1
                )
            [start] => Array
                (
                    [dateTime] => 2017-05-10T17:00:00+05:30
                    [timeZone] => Asia/Calcutta
                )
            [end] => Array
                (
                    [dateTime] => 2017-05-10T17:20:00+05:30
                    [timeZone] => Asia/Calcutta
                )
            [reminders] => Array
                (
                    [useDefault] => 1
                )
        )
)
PHP Script:
I can get etag value without producted
echo "-----".$result->getEtag(); //"2988454353000000" 
I cannot get start and end value with producted
echo "-----".$result = $event->getData(); //Error undefined method
My Refer:
Get string within protected object
How to get protected property of object in PHP
Please advice!
 
     
    