@@ -121,14 +121,14 @@ public function createDirectory($name) {
121121
122122 public function getChildren (): array {
123123 return array_map (function (AlbumFile $ file ) {
124- return new AlbumPhoto ($ this ->albumMapper , $ this ->album ->getAlbum (), $ file , $ this ->rootFolder );
124+ return new AlbumPhoto ($ this ->albumMapper , $ this ->album ->getAlbum (), $ file , $ this ->rootFolder , $ this -> user );
125125 }, $ this ->album ->getFiles ());
126126 }
127127
128128 public function getChild ($ name ): AlbumPhoto {
129129 foreach ($ this ->album ->getFiles () as $ file ) {
130130 if ($ file ->getFileId () . "- " . $ file ->getName () === $ name ) {
131- return new AlbumPhoto ($ this ->albumMapper , $ this ->album ->getAlbum (), $ file , $ this ->rootFolder );
131+ return new AlbumPhoto ($ this ->albumMapper , $ this ->album ->getAlbum (), $ file , $ this ->rootFolder , $ this -> user );
132132 }
133133 }
134134 throw new NotFound ("$ name not found " );
@@ -163,9 +163,9 @@ protected function addFile(int $sourceId, string $ownerUID): bool {
163163 throw new Conflict ("File $ sourceId is already in the folder " );
164164 }
165165 if ($ ownerUID === $ uid ) {
166- $ this ->albumMapper ->addFile ($ this ->album ->getAlbum ()->getId (), $ sourceId );
166+ $ this ->albumMapper ->addFile ($ this ->album ->getAlbum ()->getId (), $ sourceId, $ ownerUID );
167167 $ node = current ($ this ->userFolder ->getById ($ sourceId ));
168- $ this ->album ->addFile (new AlbumFile ($ sourceId , $ node ->getName (), $ node ->getMimetype (), $ node ->getSize (), $ node ->getMTime (), $ node ->getEtag (), $ node ->getCreationTime ()));
168+ $ this ->album ->addFile (new AlbumFile ($ sourceId , $ node ->getName (), $ node ->getMimetype (), $ node ->getSize (), $ node ->getMTime (), $ node ->getEtag (), $ node ->getCreationTime (), $ ownerUID ));
169169 return true ;
170170 }
171171 return false ;
0 commit comments