public function createCalendarObject($calendarId, $objectUri, $calendarData)
    {
        if (!is_array($calendarId)) {
            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
        }
        list($calendarId, $instanceId) = $calendarId;

        $extraData = $this->getDenormalizedData($calendarData);

        $stmt = $this->pdo->prepare('INSERT INTO '.$this->calendarObjectTableName.' (calendarid, uri, calendardata, lastmodified, etag, size, componenttype, firstoccurence, lastoccurence, uid) VALUES (?,?,?,?,?,?,?,?,?,?)');
        $stmt->execute([
            $calendarId,
            $objectUri,
            $calendarData,
            time(),
            $extraData['etag'],
            $extraData['size'],
            $extraData['componentType'],
            $extraData['firstOccurence'],
            $extraData['lastOccurence'],
            $extraData['uid'],
        ]);
        $this->addChange($calendarId, $objectUri, 1);

        return '"'.$extraData['etag'].'"';
    }
public function createCalendarObject($calendarId, $objectUri, $calendarData)
    {
        if (!is_array($calendarId)) {
            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
        }
        list($calendarId, $instanceId) = $calendarId;

        $extraData = $this->getDenormalizedData($calendarData);

        $stmt = $this->pdo->prepare('INSERT INTO '.$this->calendarObjectTableName.' (calendarid, uri, calendardata, lastmodified, etag, size, componenttype, firstoccurence, lastoccurence, uid) VALUES (?,?,?,?,?,?,?,?,?,?)');
        $stmt->execute([
            $calendarId,
            $objectUri,
            $calendarData,
            time(),
            $extraData['etag'],
            $extraData['size'],
            $extraData['componentType'],
            $extraData['firstOccurence'],
            $extraData['lastOccurence'],
            $extraData['uid'],
        ]);
        $this->addChange($calendarId, $objectUri, 1);

        return '"'.$extraData['etag'].'"';
    }
public function createCalendarObject ( $ calendarId , $ objectUri , $ calendarData ) { if ( ! is_array ( $ calendarId ) ) { throw new \ InvalidArgumentException ( 'The value passed to $calendarId is expected to be an array with a calendarId and an instanceId' ) ; } list ( $ calendarId , $ instanceId ) = $ calendarId ; $ extraData = $ this -> getDenormalizedData ( $ calendarData ) ; $ stmt = $ this -> pdo -> prepare ( 'INSERT INTO ' . $ this -> calendarObjectTableName . ' (calendarid, uri, calendardata, lastmodified, etag, size, componenttype, firstoccurence, lastoccurence, uid) VALUES (?,?,?,?,?,?,?,?,?,?)' ) ; $ stmt -> execute ( [ $ calendarId , $ objectUri , $ calendarData , time ( ) , $ extraData [ 'etag' ] , $ extraData [ 'size' ] , $ extraData [ 'componentType' ] , $ extraData [ 'firstOccurence' ] , $ extraData [ 'lastOccurence' ] , $ extraData [ 'uid' ] , ] ) ; $ this -> addChange ( $ calendarId , $ objectUri , 1 ) ; return '"' . $ extraData [ 'etag' ] . '"' ; }
Creates a new calendar object.

The object uri is only the basename, or filename and not a full path.

It is possible return an etag from this function, which will be used in
the response to this PUT request. Note that the ETag must be surrounded
by double-quotes.

However, you should only really return this ETag if you don't mangle the
calendar-data. If the result of a subsequent GET to this object is not
the exact same as this request body, you should omit the ETag.

@param mixed  $calendarId
@param string $objectUri
@param string $calendarData

@return string|null
Creates a new calendar object .