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
module-elasticsearch
SearchAdapter
ResponseFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Elasticsearch\SearchAdapter
;
7
8
use
Magento\Framework\ObjectManagerInterface
;
9
15
class
ResponseFactory
16
{
23
protected
$objectManager
;
24
31
protected
$documentFactory
;
32
39
protected
$aggregationFactory
;
40
46
public
function
__construct
(
47
ObjectManagerInterface
$objectManager
,
48
DocumentFactory
$documentFactory
,
49
AggregationFactory
$aggregationFactory
50
) {
51
$this->objectManager =
$objectManager
;
52
$this->documentFactory =
$documentFactory
;
53
$this->aggregationFactory =
$aggregationFactory
;
54
}
55
63
public
function
create(
$response
)
64
{
65
$documents = [];
66
foreach
(
$response
[
'documents'
] as $rawDocument) {
68
$documents[] = $this->documentFactory->create(
69
$rawDocument
70
);
71
}
73
$aggregations = $this->aggregationFactory->create(
$response
[
'aggregations'
]);
74
return
$this->objectManager->create(
75
\
Magento
\Framework\Search\
Response
\QueryResponse::class,
76
[
77
'documents'
=> $documents,
78
'aggregations'
=> $aggregations,
79
]
80
);
81
}
82
}
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
Magento\Elasticsearch\SearchAdapter\DocumentFactory
Definition:
DocumentFactory.php:21
$response
$response
Definition:
404.php:11
Magento\Elasticsearch\SearchAdapter\ResponseFactory\__construct
__construct(ObjectManagerInterface $objectManager, DocumentFactory $documentFactory, AggregationFactory $aggregationFactory)
Definition:
ResponseFactory.php:46
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Elasticsearch\SearchAdapter\ResponseFactory\$aggregationFactory
$aggregationFactory
Definition:
ResponseFactory.php:39
Magento\Elasticsearch\SearchAdapter\ResponseFactory\$objectManager
$objectManager
Definition:
ResponseFactory.php:23
Magento
Magento\Elasticsearch\SearchAdapter\ResponseFactory\$documentFactory
$documentFactory
Definition:
ResponseFactory.php:31
Magento\Elasticsearch\SearchAdapter\AggregationFactory
Definition:
AggregationFactory.php:15
Magento\Elasticsearch\SearchAdapter
Definition:
AdapterTest.php:6
Magento\Elasticsearch\SearchAdapter\ResponseFactory
Definition:
ResponseFactory.php:15