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
Setup
Declaration
Schema
Dto
Factories
Integer.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Setup\Declaration\Schema\Dto\Factories
;
8
9
use
Magento\Framework\ObjectManagerInterface
;
10
14
class
Integer
implements
FactoryInterface
15
{
21
private
static
$defaultPadding = [
22
'int'
=>
'11'
,
23
'tinyint'
=>
'2'
,
24
'smallint'
=>
'5'
,
25
'bigint'
=>
'20'
26
];
27
31
private
$objectManager;
32
36
private
$className;
37
44
public
function
__construct
(
45
ObjectManagerInterface
$objectManager,
46
$className = \
Magento
\Framework\Setup\Declaration\
Schema
\Dto\Columns\Integer::class
47
) {
48
$this->objectManager =
$objectManager
;
49
$this->className = $className;
50
}
51
55
public
function
create
(array
$data
)
56
{
57
if
(!isset(
$data
[
'padding'
])) {
58
$data
[
'padding'
] = self::$defaultPadding[
$data
[
'type'
]];
59
}
60
//Auto increment field can`t be null
61
if
(isset(
$data
[
'identity'
]) &&
$data
[
'identity'
]) {
62
$data
[
'nullable'
] =
false
;
63
}
64
65
if
(isset(
$data
[
'default'
])) {
66
$data
[
'default'
] = (int)
$data
[
'default'
];
67
}
68
69
return
$this->objectManager->create($this->className,
$data
);
70
}
71
}
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\Setup\Declaration\Schema\Dto\Factories
Definition:
Blob.php:6
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\FactoryInterface
Definition:
FactoryInterface.php:13
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Integer
Definition:
Integer.php:14
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Integer\__construct
__construct(ObjectManagerInterface $objectManager, $className=\Magento\Framework\Setup\Declaration\Schema\Dto\Columns\Integer::class)
Definition:
Integer.php:44
Magento
Magento\Framework\Setup\Declaration\Schema\Dto\Schema
Definition:
Schema.php:15
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Integer\create
create(array $data)
Definition:
Integer.php:55