From: Raphaƫl Gertz Date: Sat, 2 Nov 2024 03:53:35 +0000 (+0100) Subject: Add album reference X-Git-Tag: 0.0.6~9 X-Git-Url: https://git.rapsys.eu/treebundle/commitdiff_plain/355ee27765195aa4f8de07da693ec151ceda8346?ds=sidebyside;hp=169f1fdcb42469d234f133648462152cea92d1e1 Add album reference Cleanup --- 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;