From 355ee27765195aa4f8de07da693ec151ceda8346 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sat, 2 Nov 2024 04:53:35 +0100 Subject: [PATCH] Add album reference Cleanup --- Entity/Resource.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Entity/Resource.php b/Entity/Resource.php index 8c10d23..ca66734 100644 --- a/Entity/Resource.php +++ b/Entity/Resource.php @@ -39,7 +39,7 @@ class Resource { * * @param string $path The resource path */ - public function __construct(private User $user, private string $path) { + public function __construct(private Album $album, private User $user, private string $path) { $this->created = new \DateTime('now'); $this->updated = new \DateTime('now'); } @@ -53,10 +53,32 @@ class Resource { return $this->id; } + /** + * Set album + * + * @param \Rapsys\TreeBundle\Entity\Album $album + * + * @return Resource + */ + public function setAlbum(Album $album): Resource { + $this->album = $album; + + return $this; + } + + /** + * Get album + * + * @return \Rapsys\TreeBundle\Entity\Album + */ + public function getAlbum(): Album { + return $this->album; + } + /** * Set user * - * @param \Rapsys\BlogBundle\Entity\User $user + * @param \Rapsys\TreeBundle\Entity\User $user * * @return Resource */ @@ -69,7 +91,7 @@ class Resource { /** * Get user * - * @return \Rapsys\BlogBundle\Entity\User + * @return \Rapsys\TreeBundle\Entity\User */ public function getUser(): User { return $this->user; -- 2.41.1