Skip to content

Commit

Permalink
update document v2
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Jul 16, 2021
1 parent cf3482b commit 19a83ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ViewModel/Document/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@

use Magento\Framework\View\Element\Block\ArgumentInterface;
use Opengento\Document\Api\Data\DocumentInterface;
use Opengento\Document\Model\Document\Filesystem\Url as UrlBuilder;
use Opengento\Document\Model\Document\Filesystem\UrlResolverInterface;

final class Url implements ArgumentInterface
{
/**
* @var UrlBuilder
* @var UrlResolverInterface
*/
private $urlBuilder;
private $urlResolver;

public function __construct(
UrlBuilder $urlBuilder
UrlResolverInterface $urlResolver
) {
$this->urlBuilder = $urlBuilder;
$this->urlResolver = $urlResolver;
}

public function getFileUrl(DocumentInterface $document): string
{
return $this->urlBuilder->getFileUrl($document);
return $this->urlResolver->getFileUrl($document);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ext-dom": "*",
"magento/framework": "^103.0",
"magento/module-widget": "^101.0",
"opengento/module-document": "^1.0"
"opengento/module-document": "^2.0"
},
"require-dev": {
"magento/magento-coding-standard": "^5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $target = $block->getData('target') ? 'target="' . $block->getData('target') . '
<?= $block->getChildBlock('imageRenderer')->setData('image', $imageHelper->getImage($document, 'document_widget_list'))->toHtml() ?>
</a>
<strong class="document name document-item-name">
<a class="document-item-link" href="<?= $escaper->escapeUrl($urlHelper->getFileUrl($document)) ?>">
<a class="document-item-link" href="<?= $escaper->escapeUrl($urlHelper->getFileUrl($document)) ?>" <?= $target ?>>
<?= $escaper->escapeHtml($document->getName()) ?>
</a>
</strong>
Expand Down

0 comments on commit 19a83ca

Please sign in to comment.