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-authorizenet
Helper
DataFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Authorizenet\Helper
;
7
8
use
Magento\Framework\Exception\LocalizedException
;
9
use
Magento\Framework\ObjectManagerInterface
;
10
14
class
DataFactory
15
{
16
const
AREA_FRONTEND
=
'frontend'
;
17
const
AREA_BACKEND
=
'adminhtml'
;
18
22
protected
$objectManager
;
23
27
protected
$helperMap
= [
28
self::AREA_FRONTEND => \Magento\Authorizenet\Helper\Data::class,
29
self::AREA_BACKEND => \Magento\Authorizenet\Helper\Backend\Data::class
30
];
31
37
public
function
__construct
(
ObjectManagerInterface
$objectManager
)
38
{
39
$this->objectManager =
$objectManager
;
40
}
41
49
public
function
create
($area)
50
{
51
if
(!isset($this->helperMap[$area])) {
52
throw
new
LocalizedException
(
__
(sprintf(
'For this area <%s> no suitable helper'
, $area)));
53
}
54
55
return
$this->objectManager->get($this->helperMap[$area]);
56
}
57
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Authorizenet\Helper
Magento\Authorizenet\Helper\DataFactory\$objectManager
$objectManager
Definition:
DataFactory.php:22
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Authorizenet\Helper\DataFactory\AREA_FRONTEND
const AREA_FRONTEND
Definition:
DataFactory.php:16
__
__()
Definition:
__.php:13
Magento\Authorizenet\Helper\DataFactory\$helperMap
$helperMap
Definition:
DataFactory.php:27
Magento\Authorizenet\Helper\DataFactory
Definition:
DataFactory.php:14
Magento\Authorizenet\Helper\DataFactory\create
create($area)
Definition:
DataFactory.php:49
Magento\Authorizenet\Helper\DataFactory\__construct
__construct(ObjectManagerInterface $objectManager)
Definition:
DataFactory.php:37
Magento\Authorizenet\Helper\DataFactory\AREA_BACKEND
const AREA_BACKEND
Definition:
DataFactory.php:17