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-catalog
Model
Factory.php
Go to the documentation of this file.
1
<?php
10
namespace
Magento\Catalog\Model
;
11
12
class
Factory
13
{
19
protected
$_objectManager
;
20
26
public
function
__construct
(\
Magento
\Framework\
ObjectManagerInterface
$objectManager
)
27
{
28
$this->_objectManager =
$objectManager
;
29
}
30
39
public
function
create
(
$className
, array
$data
= [])
40
{
41
$model
= $this->_objectManager->create(
$className
,
$data
);
42
43
if
(!
$model
instanceof \
Magento
\Framework\Model\
AbstractModel
) {
44
throw
new \Magento\Framework\Exception\LocalizedException(
45
__
(
'%1 doesn\'t extends \Magento\Framework\Model\AbstractModel'
,
$className
)
46
);
47
}
48
return
$model
;
49
}
50
}
Magento\Catalog\Model\Factory\$_objectManager
$_objectManager
Definition:
Factory.php:19
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
$model
$model
Definition:
enable_catalog_product_reindex_schedule.php:9
__
__()
Definition:
__.php:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\DataObject\Factory
Definition:
Factory.php:8
Magento
Magento\Catalog\Model\Factory\create
create($className, array $data=[])
Definition:
Factory.php:39
Magento\Catalog\Model
Magento\Catalog\Model\Factory\__construct
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition:
Factory.php:26
Magento\Catalog\Model\AbstractModel
Definition:
AbstractModel.php:17
$className
if($currentSelectedMethod==$_code) $className
Definition:
form.phtml:31