From f87f9cdfc4a9203054d52447f3f877184155e05b Mon Sep 17 00:00:00 2001 From: Julio Date: Mon, 13 Sep 2021 08:18:30 +0200 Subject: [PATCH] Minor - Update entities --- src/CoreBundle/Entity/Asset.php | 5 +---- src/CoreBundle/Entity/Illustration.php | 2 +- src/CoreBundle/Entity/ResourceInterface.php | 8 +++----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/CoreBundle/Entity/Asset.php b/src/CoreBundle/Entity/Asset.php index c94fc7bb38..32e8cd6b68 100644 --- a/src/CoreBundle/Entity/Asset.php +++ b/src/CoreBundle/Entity/Asset.php @@ -169,10 +169,7 @@ class Asset return str_contains($mimeType, 'video'); } - /** - * @return string - */ - public function getCrop() + public function getCrop(): ?string { return $this->crop; } diff --git a/src/CoreBundle/Entity/Illustration.php b/src/CoreBundle/Entity/Illustration.php index 9d1fc87afd..1977acbfc3 100644 --- a/src/CoreBundle/Entity/Illustration.php +++ b/src/CoreBundle/Entity/Illustration.php @@ -68,7 +68,7 @@ class Illustration extends AbstractResource implements ResourceInterface return $this; } - public function getResourceIdentifier(): int + public function getResourceIdentifier(): Uuid { return $this->getId(); } diff --git a/src/CoreBundle/Entity/ResourceInterface.php b/src/CoreBundle/Entity/ResourceInterface.php index 7584340234..1c989dcfed 100644 --- a/src/CoreBundle/Entity/ResourceInterface.php +++ b/src/CoreBundle/Entity/ResourceInterface.php @@ -6,6 +6,8 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Entity; +use Symfony\Component\Uid\Uuid; + interface ResourceInterface { public function __toString(): string; @@ -13,7 +15,7 @@ interface ResourceInterface /** * Returns the resource id identifier. Example for CDocument it will be the value of the field iid. */ - public function getResourceIdentifier(): int; + public function getResourceIdentifier(): int|Uuid; /** * Returns the resource name. Example for CDocument it will be the field "title". @@ -25,8 +27,4 @@ interface ResourceInterface public function getResourceNode(): ?ResourceNode; public function setResourceNode(ResourceNode $resourceNode); - - //public function setParent(AbstractResource $parent); - - //public function addCourseLink(Course $course, Session $session = null, CGroup $group = null, int $visibility); }