Skip to content

Commit c831fa6

Browse files
authored
[C0-3442] Добавить возможность создавать файлы с вложенными урлами
1 parent f9bf4c2 commit c831fa6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Application/Cms/File/Assembler/GetFileV1ResultAssembler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function assemble(File $file): GetFileV1ResultDto
1414
return new GetFileV1ResultDto(
1515
$file->getContent(),
1616
$file->getContentType()->getValue(),
17-
$file->getResource()->getUri()->getPathname(),
17+
$file->getResource()->getUri()->getFileName(),
1818
$file->getCacheTime()->getValue(),
1919
);
2020
}

src/Domain/Entity/ValueObject/Uri.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ public function getPathname(): string
2424
{
2525
return mb_substr($this->value, 1);
2626
}
27+
28+
public function getFileName(): string
29+
{
30+
return basename($this->value);
31+
}
2732
}

0 commit comments

Comments
 (0)