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
Search
Document.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Api\Search
;
7
8
use
Magento\Framework\Api\AbstractSimpleObject
;
9
14
class
Document
extends
AbstractSimpleObject
implements
DocumentInterface
, \IteratorAggregate
15
{
19
public
function
getId
()
20
{
21
return
$this->
_get
(self::ID);
22
}
23
27
public
function
setId
(
$id
)
28
{
29
return
$this->
setData
(self::ID,
$id
);
30
}
31
35
public
function
getCustomAttribute
(
$attributeCode
)
36
{
37
return
$this->_data[
self::CUSTOM_ATTRIBUTES
][
$attributeCode
] ??
null
;
38
}
39
43
public
function
setCustomAttribute
(
$attributeCode
, $attributeValue)
44
{
46
$attributes
= $this->
getCustomAttributes
();
47
$attributes
[
$attributeCode
] = $attributeValue;
48
return
$this->
setCustomAttributes
(
$attributes
);
49
}
50
54
public
function
getCustomAttributes
()
55
{
56
return
$this->
_get
(self::CUSTOM_ATTRIBUTES);
57
}
58
62
public
function
setCustomAttributes
(array
$attributes
)
63
{
64
return
$this->
setData
(self::CUSTOM_ATTRIBUTES,
$attributes
);
65
}
66
73
public
function
getIterator
()
74
{
75
$attributes
= (array)$this->
getCustomAttributes
();
76
return
new \ArrayIterator(
$attributes
);
77
}
78
}
Magento\Framework\Api\Search\Document\getCustomAttributes
getCustomAttributes()
Definition:
Document.php:54
Magento\Framework\Api\Search\Document\getCustomAttribute
getCustomAttribute($attributeCode)
Definition:
Document.php:35
$id
$id
Definition:
fieldset.phtml:14
Magento\Framework\Api\Search\DocumentInterface
Definition:
DocumentInterface.php:14
Magento\Framework\Api\CustomAttributesDataInterface\CUSTOM_ATTRIBUTES
const CUSTOM_ATTRIBUTES
Definition:
CustomAttributesDataInterface.php:20
Magento\Framework\Api\AbstractSimpleObject
Definition:
AbstractSimpleObject.php:12
Magento\Framework\Api\Search\Document\setId
setId($id)
Definition:
Document.php:27
Magento\Framework\Api\CustomAttributesDataInterface\setCustomAttribute
setCustomAttribute($attributeCode, $attributeValue)
Magento\Framework\Api\AbstractSimpleObject\_get
_get($key)
Definition:
AbstractSimpleObject.php:35
$attributeCode
$attributeCode
Definition:
extend.phtml:12
Magento\Framework\Api\Search
Definition:
AggregationInterface.php:6
Magento\Framework\Api\Search\Document\setCustomAttributes
setCustomAttributes(array $attributes)
Definition:
Document.php:62
$attributes
$attributes
Definition:
matrix.phtml:13
Magento\Framework\Api\Search\Document\getIterator
getIterator()
Definition:
Document.php:73
Magento\Framework\Api\AbstractSimpleObject\setData
setData($key, $value)
Definition:
AbstractSimpleObject.php:47
Magento\Framework\Api\Search\Document\getId
getId()
Definition:
Document.php:19
Magento\Framework\Api\Search\Document
Definition:
Document.php:14