container->get( 'pvr_ezcomment.manager' ); try { $manager->deleteById( $commentId, $this->container->get( 'ezpublish.connection' ) ); } catch (NotFoundException $e) { return new Exceptions\NotFoundException($e->getMessage()); } return new Values\NoContent(); } /** * Update a status on a comment from Platform UI * * @param $commentId * @param $statusId * @return Exceptions\NotFoundException|Values\NoContent */ public function status( $commentId, $statusId ) { $manager = $this->container->get( 'pvr_ezcomment.manager' ); try { $connection = $this->container->get( 'ezpublish.connection' ); if ( $manager->commentExists($commentId, $connection) && in_array($statusId, [PvrEzCommentManager::COMMENT_WAITING, PvrEzCommentManager::COMMENT_ACCEPT, PvrEzCommentManager::COMMENT_REJECTED] ) ) { $manager->updateStatusFromUI( $connection, $commentId, $statusId ); } else { return new Exceptions\NotFoundException("Comment or Status wasn't found on server !"); } } catch (NotFoundException $e) { return new Exceptions\NotFoundException($e->getMessage()); } return new Values\NoContent(); } }