diff --git a/src/contracts/Repository/ContentService.php b/src/contracts/Repository/ContentService.php index 4db6c57b7f..6a90733779 100644 --- a/src/contracts/Repository/ContentService.php +++ b/src/contracts/Repository/ContentService.php @@ -340,11 +340,6 @@ public function updateContent(VersionInfo $versionInfo, ContentUpdateStruct $con * Publishes a content version and deletes archive versions if they overflow max archive versions. * Max archive versions are currently a configuration for default max limit, by default set to 5. * - * @todo Introduce null|int ContentType->versionArchiveLimit to be able to let admins override this per type. - * - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to publish this version - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException if the version is not a draft - * * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo * @param string[] $translations List of language codes of translations which will be included * in a published version. @@ -354,6 +349,13 @@ public function updateContent(VersionInfo $versionInfo, ContentUpdateStruct $con * overriding those in the current version. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content + * + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to publish this version + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException if the version is not a draft + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException */ public function publishVersion(VersionInfo $versionInfo, array $translations = Language::ALL): Content; diff --git a/src/lib/Repository/ContentService.php b/src/lib/Repository/ContentService.php index a2388e97da..9cd24b9438 100644 --- a/src/lib/Repository/ContentService.php +++ b/src/lib/Repository/ContentService.php @@ -1449,22 +1449,6 @@ protected function internalUpdateContent( ); } - /** - * Publishes a content version. - * - * Publishes a content version and deletes archive versions if they overflow max archive versions. - * Max archive versions are currently a configuration, but might be moved to be a param of ContentType in the future. - * - * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo - * @param string[] $translations - * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content - * - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException if the version is not a draft - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException - */ public function publishVersion(APIVersionInfo $versionInfo, array $translations = Language::ALL): APIContent { $content = $this->internalLoadContentById( @@ -1721,13 +1705,16 @@ protected function fieldValuesAreEqual(FieldType $fieldType, Value $value1, Valu * Publishes a content version and deletes archive versions if they overflow max archive versions. * Max archive versions are currently a configuration, but might be moved to be a param of ContentType in the future. * - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException if the version is not a draft - * * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo * @param int|null $publicationDate If null existing date is kept if there is one, otherwise current time is used. * @param string[] $translations * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content + * + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException if the version is not a draft + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException */ protected function internalPublishVersion(APIVersionInfo $versionInfo, $publicationDate = null, array $translations = Language::ALL) {