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
GraphQl
Schema
Type
Output
OutputFactory.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Framework\GraphQl\Schema\Type\Output
;
9
10
use
Magento\Framework\GraphQl\Config\ConfigElementInterface
;
11
use
Magento\Framework\GraphQl\Schema\Type\OutputTypeInterface
;
12
use
Magento\Framework\ObjectManagerInterface
;
13
17
class
OutputFactory
18
{
22
private
$objectManager;
23
27
private
$prototypes;
28
32
private
$typeRegistry;
33
38
public
function
__construct
(
39
ObjectManagerInterface
$objectManager,
40
array $prototypes
41
) {
42
$this->objectManager =
$objectManager
;
43
$this->prototypes = $prototypes;
44
}
45
52
public
function
create
(
ConfigElementInterface
$configElement) :
OutputTypeInterface
53
{
54
if
(!isset($this->typeRegistry[$configElement->
getName
()])) {
55
$this->typeRegistry[$configElement->
getName
()] =
56
$this->objectManager->create(
57
$this->prototypes[get_class($configElement)],
58
[
59
'configElement'
=> $configElement
60
]
61
);
62
}
63
return
$this->typeRegistry[$configElement->
getName
()];
64
}
65
}
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\GraphQl\Schema\Type\Output\OutputFactory\__construct
__construct(ObjectManagerInterface $objectManager, array $prototypes)
Definition:
OutputFactory.php:38
Magento\Framework\GraphQl\Config\ConfigElementInterface
Definition:
ConfigElementInterface.php:13
Magento\Framework\GraphQl\Config\ConfigElementInterface\getName
getName()
Magento\Framework\GraphQl\Schema\Type\Output\OutputFactory
Definition:
OutputFactory.php:17
Magento\Framework\GraphQl\Schema\Type\Output
Magento\Framework\GraphQl\Schema\Type\Output\OutputFactory\create
create(ConfigElementInterface $configElement)
Definition:
OutputFactory.php:52
Magento\Framework\GraphQl\Schema\Type\OutputTypeInterface
Definition:
OutputTypeInterface.php:15