public function processMessage(Message $itipMessage, VCalendar $existingObject = null)
    {
        // We only support events at the moment.
        if ('VEVENT' !== $itipMessage->component) {
            return false;
        }

        switch ($itipMessage->method) {
            case 'REQUEST':
                return $this->processMessageRequest($itipMessage, $existingObject);

            case 'CANCEL':
                return $this->processMessageCancel($itipMessage, $existingObject);

            case 'REPLY':
                return $this->processMessageReply($itipMessage, $existingObject);

            default:
                // Unsupported iTip message
                return;
        }

        return $existingObject;
    }
public function processMessage(Message $itipMessage, VCalendar $existingObject = null)
    {
        // We only support events at the moment.
        if ('VEVENT' !== $itipMessage->component) {
            return false;
        }

        switch ($itipMessage->method) {
            case 'REQUEST':
                return $this->processMessageRequest($itipMessage, $existingObject);

            case 'CANCEL':
                return $this->processMessageCancel($itipMessage, $existingObject);

            case 'REPLY':
                return $this->processMessageReply($itipMessage, $existingObject);

            default:
                // Unsupported iTip message
                return;
        }

        return $existingObject;
    }
public function processMessage ( Message $ itipMessage , VCalendar $ existingObject = null ) { // We only support events at the moment. if ( 'VEVENT' !== $ itipMessage -> component ) { return false ; } switch ( $ itipMessage -> method ) { case 'REQUEST' : return $ this -> processMessageRequest ( $ itipMessage , $ existingObject ) ; case 'CANCEL' : return $ this -> processMessageCancel ( $ itipMessage , $ existingObject ) ; case 'REPLY' : return $ this -> processMessageReply ( $ itipMessage , $ existingObject ) ; default : // Unsupported iTip message return ; } return $ existingObject ; }
This method is used to process an incoming itip message.

Examples:

1. A user is an attendee to an event. The organizer sends an updated
meeting using a new iTip message with METHOD:REQUEST. This function
will process the message and update the attendee's event accordingly.

2. The organizer cancelled the event using METHOD:CANCEL. We will update
the users event to state STATUS:CANCELLED.

3. An attendee sent a reply to an invite using METHOD:REPLY. We can
update the organizers event to update the ATTENDEE with its correct
PARTSTAT.

The $existingObject is updated in-place. If there is no existing object
(because it's a new invite for example) a new object will be created.

If an existing object does not exist, and the method was CANCEL or
REPLY, the message effectively gets ignored, and no 'existingObject'
will be created.

The updated $existingObject is also returned from this function.

If the iTip message was not supported, we will always return false.

@param Message   $itipMessage
@param VCalendar $existingObject

@return VCalendar|null
This method is used to process an incoming itip message .