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
framework
Pricing
Price
Factory.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Pricing\Price
;
8
9
use
Magento\Framework\Pricing\SaleableInterface
;
10
14
class
Factory
15
{
21
protected
$objectManager
;
22
28
public
function
__construct
(\
Magento
\Framework\
ObjectManagerInterface
$objectManager
)
29
{
30
$this->objectManager =
$objectManager
;
31
}
32
43
public
function
create
(
SaleableInterface
$saleableItem,
$className
, $quantity, array
$arguments
= [])
44
{
45
$arguments
[
'saleableItem'
] = $saleableItem;
46
$arguments
[
'quantity'
] = $quantity;
47
$price
= $this->objectManager->create(
$className
,
$arguments
);
48
if
(!
$price
instanceof
PriceInterface
) {
49
throw
new \InvalidArgumentException(
50
$className
.
' doesn\'t implement \Magento\Framework\Pricing\Price\PriceInterface'
51
);
52
}
53
return
$price
;
54
}
55
}
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\Pricing\Price\Factory\$objectManager
$objectManager
Definition:
Factory.php:21
$price
$price
Definition:
product_alert.php:10
Magento\Framework\Pricing\Price
Definition:
AbstractPrice.php:7
Magento\Framework\Pricing\Price\Factory\create
create(SaleableInterface $saleableItem, $className, $quantity, array $arguments=[])
Definition:
Factory.php:43
Magento\Framework\Pricing\Price\Factory\__construct
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition:
Factory.php:28
Magento
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Framework\Pricing\Price\Factory
Definition:
Factory.php:14
Magento\Framework\Pricing\SaleableInterface
Definition:
SaleableInterface.php:15
Magento\Framework\Pricing\Price\PriceInterface
Definition:
PriceInterface.php:17
$className
if($currentSelectedMethod==$_code) $className
Definition:
form.phtml:31