]> Raphaƫl G. Git Repositories - treebundle/blobdiff - Entity/Resource.php
Add albums creation
[treebundle] / Entity / Resource.php
index 8c10d236e0dca04cc2ab9ac06fe85180c2b98be0..ca66734554a804768e3c9bb2f071ab9b1b042504 100644 (file)
@@ -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;