apps/dav/lib/Comments/CommentsPlugin.php
/**
	 * POST operation on Comments collections
	 *
	 * @param RequestInterface $request request object
	 * @param ResponseInterface $response response object
	 * @return null|false
	 */
POST operation on Comments collections
@param RequestInterface $request request object
@param ResponseInterface $response response object
@return null|false
POST operation on Comments collections @param RequestInterface $request request object @param ResponseInterface $response response object @return null|false
public function httpPost(RequestInterface $request, ResponseInterface $response) {
		$path = $request->getPath();
		$node = $this->server->tree->getNodeForPath($path);
		if (!$node instanceof EntityCollection) {
			return null;
		}
		$data = $request->getBodyAsString();
		$comment = $this->createComment(
			$node->getName(),
			$node->getId(),
			$data,
			$request->getHeader('Content-Type')
		);
		$node->setReadMarker(null);
		$url = rtrim($request->getUrl(), '/') . '/' . urlencode($comment->getId());
		$response->setHeader('Content-Location', $url);
		$response->setStatus(201);
		return false;
	}
public function httpPost ( RequestInterface $ request , ResponseInterface $ response ) { $ path = $ request -> getPath ( ) ; $ node = $ this -> server -> tree -> getNodeForPath ( $ path ) ; if ( ! $ node instanceof EntityCollection ) { return null ; } $ data = $ request -> getBodyAsString ( ) ; $ comment = $ this -> createComment ( $ node -> getName ( ) , $ node -> getId ( ) , $ data , $ request -> getHeader ( 'Content-Type' ) ) ; $ node -> setReadMarker ( null ) ; $ url = rtrim ( $ request -> getUrl ( ) , '/' ) . '/' . urlencode ( $ comment -> getId ( ) ) ; $ response -> setHeader ( 'Content-Location' , $ url ) ; $ response -> setStatus ( 201 ) ; return false ; }
POST operation on Comments collections
 @param RequestInterface $request request object
 @param ResponseInterface $response response object
 @return null|false
POST operation on Comments collections @param RequestInterface $request request object @param ResponseInterface $response response object @return null|false
// update read marker for the current user/poster to avoid // having their own comments marked as unread // created