public function putDocument(Path $p, $contentType, $documentData, array $ifMatch = null, array $ifNoneMatch = null) { if (null !== $ifMatch && !in_array($this->md->getVersion($p), $ifMatch)) { throw new PreconditionFailedException('version mismatch'); } if (null !== $ifNoneMatch && in_array('*', $ifNoneMatch) && null !== $this->md->getVersion($p)) { throw new PreconditionFailedException('document already exists'); } $updatedEntities = $this->d->putDocument($p, $documentData); $this->md->updateDocument($p, $contentType); foreach ($updatedEntities as $u) { $this->md->updateFolder(new Path($u)); } }