From 19a83caab0ef58b2afc8126c3e738812747c0169 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 16 Jul 2021 12:30:38 +0200 Subject: [PATCH] update document v2 --- ViewModel/Document/Url.php | 12 ++++++------ composer.json | 2 +- .../widget/document/list/default_list.phtml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ViewModel/Document/Url.php b/ViewModel/Document/Url.php index bcc9552..5814a96 100644 --- a/ViewModel/Document/Url.php +++ b/ViewModel/Document/Url.php @@ -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); } } diff --git a/composer.json b/composer.json index a1b1bc0..44fc7e5 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/view/frontend/templates/widget/document/list/default_list.phtml b/view/frontend/templates/widget/document/list/default_list.phtml index cd5a8ea..d0ce6cb 100644 --- a/view/frontend/templates/widget/document/list/default_list.phtml +++ b/view/frontend/templates/widget/document/list/default_list.phtml @@ -40,7 +40,7 @@ $target = $block->getData('target') ? 'target="' . $block->getData('target') . ' getChildBlock('imageRenderer')->setData('image', $imageHelper->getImage($document, 'document_widget_list'))->toHtml() ?> - + > escapeHtml($document->getName()) ?>