protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null)
    {
        if (!$existingObject) {
            // This is a new invite, and we're just going to copy over
            // all the components from the invite.
            $existingObject = new VCalendar();
            foreach ($itipMessage->message->getComponents() as $component) {
                $existingObject->add(clone $component);
            }
        } else {
            // We need to update an existing object with all the new
            // information. We can just remove all existing components
            // and create new ones.
            foreach ($existingObject->getComponents() as $component) {
                $existingObject->remove($component);
            }
            foreach ($itipMessage->message->getComponents() as $component) {
                $existingObject->add(clone $component);
            }
        }

        return $existingObject;
    }
protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null)
    {
        if (!$existingObject) {
            // This is a new invite, and we're just going to copy over
            // all the components from the invite.
            $existingObject = new VCalendar();
            foreach ($itipMessage->message->getComponents() as $component) {
                $existingObject->add(clone $component);
            }
        } else {
            // We need to update an existing object with all the new
            // information. We can just remove all existing components
            // and create new ones.
            foreach ($existingObject->getComponents() as $component) {
                $existingObject->remove($component);
            }
            foreach ($itipMessage->message->getComponents() as $component) {
                $existingObject->add(clone $component);
            }
        }

        return $existingObject;
    }
protected function processMessageRequest ( Message $ itipMessage , VCalendar $ existingObject = null ) { if ( ! $ existingObject ) { // This is a new invite, and we're just going to copy over // all the components from the invite. $ existingObject = new VCalendar ( ) ; foreach ( $ itipMessage -> message -> getComponents ( ) as $ component ) { $ existingObject -> add ( clone $ component ) ; } } else { // We need to update an existing object with all the new // information. We can just remove all existing components // and create new ones. foreach ( $ existingObject -> getComponents ( ) as $ component ) { $ existingObject -> remove ( $ component ) ; } foreach ( $ itipMessage -> message -> getComponents ( ) as $ component ) { $ existingObject -> add ( clone $ component ) ; } } return $ existingObject ; }
Processes incoming REQUEST messages.

This is message from an organizer, and is either a new event
invite, or an update to an existing one.


@param Message   $itipMessage
@param VCalendar $existingObject

@return VCalendar|null
Processes incoming REQUEST messages .