Skip to content

Commit

Permalink
Merge pull request #4074 from oat-sa/fix/ADF-1741/move-to-for-class-f…
Browse files Browse the repository at this point in the history
…ixed

MoveTo Action for class fixed
  • Loading branch information
bartlomiejmarszal authored Jul 10, 2024
2 parents 99cf559 + b6fc02a commit 7152e45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions actions/class.RdfController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,13 @@ private function getResourceTransfer(): ResourceTransferInterface

private function getResourceParentClass(string $id): string
{
if ($this->getResource($id)->isClass()) {
$directParent = $this->getResource($id)->getParentClassesIds();
return reset($directParent);
}

$types = $this->getResource($id)->getTypes();

if (count($types) !== 1) {
throw new InvalidArgumentException('Resource has no class or resource types are ambiguous');
}
Expand Down

0 comments on commit 7152e45

Please sign in to comment.