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
Api
AbstractSimpleObject.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Api
;
7
12
abstract
class
AbstractSimpleObject
13
{
17
protected
$_data
;
18
24
public
function
__construct
(array
$data
= [])
25
{
26
$this->_data =
$data
;
27
}
28
35
protected
function
_get
($key)
36
{
37
return
$this->_data[$key] ??
null
;
38
}
39
47
public
function
setData
($key,
$value
)
48
{
49
$this->_data[$key] =
$value
;
50
return
$this;
51
}
52
58
public
function
__toArray
()
59
{
60
$data
=
$this->_data
;
61
$hasToArray =
function
(
$model
) {
62
return
is_object(
$model
) && method_exists(
$model
,
'__toArray'
) && is_callable([
$model
,
'__toArray'
]);
63
};
64
foreach
(
$data
as $key =>
$value
) {
65
if
($hasToArray(
$value
)) {
66
$data
[$key] =
$value
->__toArray();
67
}
elseif
(is_array(
$value
)) {
68
foreach
(
$value
as $nestedKey => $nestedValue) {
69
if
($hasToArray($nestedValue)) {
70
$value
[$nestedKey] = $nestedValue->__toArray();
71
}
72
}
73
$data
[$key] =
$value
;
74
}
75
}
76
return
$data
;
77
}
78
}
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Framework\Api
Definition:
AbstractExtensibleObject.php:6
$model
$model
Definition:
enable_catalog_product_reindex_schedule.php:9
Magento\Framework\Api\AbstractSimpleObject
Definition:
AbstractSimpleObject.php:12
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Api\AbstractSimpleObject\_get
_get($key)
Definition:
AbstractSimpleObject.php:35
Magento\Framework\Api\AbstractSimpleObject\$_data
$_data
Definition:
AbstractSimpleObject.php:17
Magento\Framework\Api\AbstractSimpleObject\__toArray
__toArray()
Definition:
AbstractSimpleObject.php:58
Magento\Framework\Api\AbstractSimpleObject\setData
setData($key, $value)
Definition:
AbstractSimpleObject.php:47
Magento\Framework\Api\AbstractSimpleObject\__construct
__construct(array $data=[])
Definition:
AbstractSimpleObject.php:24