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-captcha
Model
CaptchaFactory.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\Captcha\Model
;
9
10
class
CaptchaFactory
11
{
15
protected
$_objectManager
;
16
20
public
function
__construct
(\
Magento
\Framework\ObjectManagerInterface
$objectManager
)
21
{
22
$this->_objectManager =
$objectManager
;
23
}
24
33
public
function
create
($captchaType, $formId)
34
{
35
$className
=
'Magento\Captcha\Model\\'
. ucfirst($captchaType);
36
37
$instance = $this->_objectManager->create(
$className
, [
'formId'
=> $formId]);
38
if
(!$instance instanceof \
Magento
\Captcha\Model\
CaptchaInterface
) {
39
throw
new \InvalidArgumentException(
40
$className
.
' does not implement \Magento\Captcha\Model\CaptchaInterface'
41
);
42
}
43
return
$instance;
44
}
45
}
Magento\Captcha\Model\CaptchaFactory\$_objectManager
$_objectManager
Definition:
CaptchaFactory.php:15
Magento\Captcha\Model\CaptchaFactory\create
create($captchaType, $formId)
Definition:
CaptchaFactory.php:33
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Captcha\Model\CaptchaFactory
Definition:
CaptchaFactory.php:10
Magento\Captcha\Model\CaptchaFactory\__construct
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition:
CaptchaFactory.php:20
Magento\Captcha\Model
Definition:
CaptchaFactory.php:8
Magento
Magento\Captcha\Model\CaptchaInterface
Definition:
CaptchaInterface.php:16
$className
if($currentSelectedMethod==$_code) $className
Definition:
form.phtml:31