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
View
Asset
Collection.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Asset
;
7
11
class
Collection
12
{
18
protected
$assets
= [];
19
27
public
function
add
($identifier,
AssetInterface
$asset)
28
{
29
$this->assets[$identifier] = $asset;
30
}
31
38
public
function
insert
($identifier,
AssetInterface
$asset, $key)
39
{
40
$result
= [];
41
foreach
($this->assets as $assetKey => $assetVal) {
42
if
($assetKey == $key) {
43
$result
[$key] = $assetVal;
44
$result
[$identifier] = $asset;
45
}
else
{
46
$result
[$assetKey] = $assetVal;
47
}
48
}
49
50
$this->assets =
$result
;
51
}
52
59
public
function
has
($identifier)
60
{
61
return
isset($this->assets[$identifier]);
62
}
63
70
public
function
remove
($identifier)
71
{
72
unset($this->assets[$identifier]);
73
}
74
80
public
function
getAll
()
81
{
82
return
$this->assets
;
83
}
84
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\View\Asset\Collection\has
has($identifier)
Definition:
Collection.php:59
Magento\Framework\View\Asset\Collection\add
add($identifier, AssetInterface $asset)
Definition:
Collection.php:27
Magento\Framework\View\Asset\Collection\getAll
getAll()
Definition:
Collection.php:80
Magento\Framework\View\Asset
Definition:
AssetInterface.php:6
Magento\Framework\View\Asset\Collection
Definition:
Collection.php:11
Magento\Framework\View\Asset\Collection\$assets
$assets
Definition:
Collection.php:18
Magento\Framework\View\Asset\AssetInterface
Definition:
AssetInterface.php:14
Magento\Framework\View\Asset\Collection\insert
insert($identifier, AssetInterface $asset, $key)
Definition:
Collection.php:38