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
Real.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Setup\Declaration\Schema\Dto\Factories
;
7
8
use
Magento\Framework\ObjectManagerInterface
;
9
16
class
Real
implements
FactoryInterface
17
{
21
const
DEFAULT_PRECISION
=
"10"
;
22
26
const
DEFAULT_SCALE
=
"0"
;
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\Real::class
47
) {
48
$this->objectManager =
$objectManager
;
49
$this->className = $className;
50
}
51
55
public
function
create
(array
$data
)
56
{
57
if
(!isset(
$data
[
'precision'
])) {
58
$data
[
'precision'
] = (
$data
[
'type'
] ===
'decimal'
) ? self::DEFAULT_PRECISION : 0;
59
}
60
61
if
(!isset(
$data
[
'scale'
])) {
62
$data
[
'scale'
] = (
$data
[
'type'
] ===
'decimal'
) ? self::DEFAULT_SCALE : 0;
63
}
64
65
if
(isset(
$data
[
'default'
])) {
66
$data
[
'default'
] = floatval(
$data
[
'default'
]);
67
}
68
69
return
$this->objectManager->create($this->className,
$data
);
70
}
71
}
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Real\DEFAULT_SCALE
const DEFAULT_SCALE
Definition:
Real.php:26
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Real
Definition:
Real.php:16
Magento\Framework\Setup\Declaration\Schema\Dto\Factories
Definition:
Blob.php:6
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\FactoryInterface
Definition:
FactoryInterface.php:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Real\create
create(array $data)
Definition:
Real.php:55
Magento
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Real\__construct
__construct(ObjectManagerInterface $objectManager, $className=\Magento\Framework\Setup\Declaration\Schema\Dto\Columns\Real::class)
Definition:
Real.php:44
Magento\Framework\Setup\Declaration\Schema\Dto\Schema
Definition:
Schema.php:15
Magento\Framework\Setup\Declaration\Schema\Dto\Factories\Real\DEFAULT_PRECISION
const DEFAULT_PRECISION
Definition:
Real.php:21