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
Collection.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Pricing\Price
;
8
9
use
Magento\Framework\Pricing\SaleableInterface
;
10
17
class
Collection
implements
\Iterator
18
{
22
protected
$pool
;
23
27
protected
$saleableItem
;
28
32
protected
$priceFactory
;
33
37
protected
$quantity
;
38
42
protected
$contains
;
43
47
protected
$excludes
;
48
54
protected
$priceModels
;
55
64
public
function
__construct
(
65
SaleableInterface
$saleableItem
,
66
Factory
$priceFactory
,
67
Pool
$pool
,
68
$quantity
69
) {
70
$this->saleableItem =
$saleableItem
;
71
$this->priceFactory =
$priceFactory
;
72
$this->pool =
$pool
;
73
$this->quantity =
$quantity
;
74
$this->priceModels = [];
75
}
76
82
public
function
rewind
()
83
{
84
return
$this->pool->rewind();
85
}
86
92
public
function
current
()
93
{
94
return
$this->
get
($this->
key
());
95
}
96
102
public
function
key
()
103
{
104
return
$this->pool->key();
105
}
106
112
public
function
next
()
113
{
114
return
$this->pool->next();
115
}
116
122
public
function
valid
()
123
{
124
return
$this->pool->valid();
125
}
126
133
public
function
get
(
$code
)
134
{
135
if
(!isset($this->priceModels[
$code
])) {
136
$this->priceModels[
$code
] = $this->priceFactory->create(
137
$this->saleableItem,
138
$this->pool[
$code
],
139
$this->quantity
140
);
141
}
142
return
$this->priceModels[
$code
];
143
}
144
}
Magento\Framework\Pricing\Price\Collection\current
current()
Definition:
Collection.php:92
Magento\Framework\Pricing\Price\Collection\next
next()
Definition:
Collection.php:112
Magento\Framework\Pricing\Price\Collection\$priceModels
$priceModels
Definition:
Collection.php:54
Magento\Framework\Pricing\Price\Collection\$contains
$contains
Definition:
Collection.php:42
Magento\Framework\Pricing\Price\Collection\valid
valid()
Definition:
Collection.php:122
Magento\Framework\Pricing\Price\Pool
Definition:
Pool.php:15
Magento\Framework\Pricing\Price\Collection\$quantity
$quantity
Definition:
Collection.php:37
Magento\Framework\Pricing\Price\Collection
Definition:
Collection.php:17
Magento\Framework\Pricing\Price
Definition:
AbstractPrice.php:7
Magento\Framework\Pricing\Price\Collection\$pool
$pool
Definition:
Collection.php:22
Magento\Framework\Pricing\Price\Collection\__construct
__construct(SaleableInterface $saleableItem, Factory $priceFactory, Pool $pool, $quantity)
Definition:
Collection.php:64
Magento\Framework\Pricing\Price\Collection\rewind
rewind()
Definition:
Collection.php:82
Magento\Framework\Pricing\Price\Factory
Definition:
Factory.php:14
Magento\Framework\Pricing\Price\Collection\$priceFactory
$priceFactory
Definition:
Collection.php:32
Magento\Framework\Pricing\Price\Collection\key
key()
Definition:
Collection.php:102
Magento\Framework\Pricing\SaleableInterface
Definition:
SaleableInterface.php:15
Magento\Framework\Pricing\Price\Collection\$saleableItem
$saleableItem
Definition:
Collection.php:27
$code
$code
Definition:
info.phtml:12
Magento\Framework\Pricing\Price\Collection\$excludes
$excludes
Definition:
Collection.php:47