diff --git a/src/lib/Server/Controller/Content/ContentVersionRelationDeleteController.php b/src/lib/Server/Controller/Content/ContentVersionRelationDeleteController.php index 48fc56af3..648c1bd7e 100644 --- a/src/lib/Server/Controller/Content/ContentVersionRelationDeleteController.php +++ b/src/lib/Server/Controller/Content/ContentVersionRelationDeleteController.php @@ -11,6 +11,7 @@ use ApiPlatform\OpenApi\Model; use Ibexa\Contracts\Core\Repository\ContentService; use Ibexa\Contracts\Core\Repository\Values\Content\Relation; +use Ibexa\Contracts\Core\Repository\Values\Content\RelationType; use Ibexa\Contracts\Rest\Exceptions; use Ibexa\Rest\Server\Controller as RestController; use Ibexa\Rest\Server\Exceptions\ForbiddenException; @@ -95,7 +96,7 @@ public function removeRelation(int $contentId, int $versionNumber, int $relation foreach ($versionRelations as $relation) { if ($relation->id == $relationId) { - if ($relation->type !== Relation::COMMON) { + if ($relation->type !== RelationType::COMMON->value) { throw new ForbiddenException('Relation is not of type COMMON'); } diff --git a/src/lib/Server/Output/ValueObjectVisitor/RestRelation.php b/src/lib/Server/Output/ValueObjectVisitor/RestRelation.php index 724ac38f8..45b6980b6 100644 --- a/src/lib/Server/Output/ValueObjectVisitor/RestRelation.php +++ b/src/lib/Server/Output/ValueObjectVisitor/RestRelation.php @@ -7,7 +7,7 @@ namespace Ibexa\Rest\Server\Output\ValueObjectVisitor; -use Ibexa\Contracts\Core\Repository\Values\Content\Relation as RelationValue; +use Ibexa\Contracts\Core\Repository\Values\Content\RelationType; use Ibexa\Contracts\Rest\Output\Generator; use Ibexa\Contracts\Rest\Output\ValueObjectVisitor; use Ibexa\Contracts\Rest\Output\Visitor; @@ -92,19 +92,19 @@ protected function getRelationTypeString($relationType) { $relationTypeList = []; - if (RelationValue::COMMON & $relationType) { + if (RelationType::COMMON->value & $relationType) { $relationTypeList[] = 'COMMON'; } - if (RelationValue::EMBED & $relationType) { + if (RelationType::EMBED->value & $relationType) { $relationTypeList[] = 'EMBED'; } - if (RelationValue::LINK & $relationType) { + if (RelationType::LINK->value & $relationType) { $relationTypeList[] = 'LINK'; } - if (RelationValue::FIELD & $relationType) { + if (RelationType::FIELD->value & $relationType) { $relationTypeList[] = 'ATTRIBUTE'; } - if (RelationValue::ASSET & $relationType) { + if (RelationType::ASSET->value & $relationType) { $relationTypeList[] = 'ASSET'; }