Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Model
Product
Attribute
Frontend
Image.php
Go to the documentation of this file.
1
<?php
13
namespace
Magento\Catalog\Model\Product\Attribute\Frontend
;
14
15
use
Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend
;
16
use
Magento\Framework\UrlInterface
;
17
use
Magento\Store\Model\StoreManagerInterface
;
18
19
class
Image
extends
AbstractFrontend
20
{
26
protected
$_storeManager
;
27
33
public
function
__construct
(
StoreManagerInterface
$storeManager)
34
{
35
$this->_storeManager =
$storeManager
;
36
}
37
45
public
function
getUrl
(
$product
)
46
{
47
$image
=
$product
->getData($this->
getAttribute
()->getAttributeCode());
48
$url
=
false
;
49
if
(!empty(
$image
)) {
50
$url
= $this->_storeManager
51
->getStore(
$product
->getStore())
52
->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) .
'catalog/product/'
. ltrim(
$image
,
'/'
);
53
}
54
return
$url
;
55
}
56
}
Magento\Catalog\Model\Product\Attribute\Frontend
Definition:
Image.php:13
$url
$url
Definition:
query_redirect.php:14
Magento\Catalog\Model\Product\Attribute\Frontend\Image\__construct
__construct(StoreManagerInterface $storeManager)
Definition:
Image.php:33
$image
$image
Definition:
product_export_with_images.php:32
$storeManager
$storeManager
Definition:
paypal_quote.php:14
Magento\Framework\UrlInterface
Definition:
UrlInterface.php:12
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Catalog\Model\Product\Attribute\Frontend\Image\getUrl
getUrl($product)
Definition:
Image.php:45
Magento\Catalog\Model\Product\Attribute\Frontend\Image
Definition:
Image.php:19
Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend
Definition:
AbstractFrontend.php:26
Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend\getAttribute
getAttribute()
Definition:
AbstractFrontend.php:111
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Catalog\Model\Product\Attribute\Frontend\Image\$_storeManager
$_storeManager
Definition:
Image.php:26