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
SchemaListenerDefinition
TimestampDefinition.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Setup\SchemaListenerDefinition
;
8
9
use
Magento\Framework\DB\Ddl\Table
;
10
14
class
TimestampDefinition
implements
DefinitionConverterInterface
15
{
19
public
function
convertToDefinition
(array $definition)
20
{
21
$cDefault = $definition[
'default'
] ??
null
;
22
$cNullable = $definition[
'nullable'
] ??
true
;
23
$onUpdate =
false
;
24
if
($cDefault ===
null
&& !$cNullable) {
25
$cDefault =
'NULL'
;
26
}
elseif
($cDefault ==
Table::TIMESTAMP_INIT
) {
27
$cDefault =
'CURRENT_TIMESTAMP'
;
28
}
elseif
($cDefault ==
Table::TIMESTAMP_UPDATE
) {
29
$cDefault =
'0'
;
30
$onUpdate =
true
;
31
}
elseif
($cDefault ==
Table::TIMESTAMP_INIT_UPDATE
) {
32
$cDefault =
'CURRENT_TIMESTAMP'
;
33
$onUpdate =
true
;
34
}
elseif
(!$cNullable && !$cDefault && $definition[
'type'
] ===
'timestamp'
) {
35
$cDefault =
'CURRENT_TIMESTAMP'
;
36
$onUpdate =
true
;
37
$cNullable =
true
;
38
}
39
40
return
[
41
'xsi:type'
=> $definition[
'type'
],
42
'name'
=> $definition[
'name'
],
43
'on_update'
=> $onUpdate,
44
'nullable'
=> $cNullable,
45
'default'
=> $cDefault
46
];
47
}
48
}
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Framework\Setup\SchemaListenerDefinition\DefinitionConverterInterface
Definition:
DefinitionConverterInterface.php:12
Magento\Framework\Setup\SchemaListenerDefinition\TimestampDefinition
Definition:
TimestampDefinition.php:14
Magento\Framework\DB\Ddl\Table\TIMESTAMP_INIT_UPDATE
const TIMESTAMP_INIT_UPDATE
Definition:
Table.php:63
Magento\Framework\Setup\SchemaListenerDefinition
Definition:
BooleanDefinition.php:7
Magento\Framework\DB\Ddl\Table\TIMESTAMP_INIT
const TIMESTAMP_INIT
Definition:
Table.php:65
Magento\Framework\DB\Ddl\Table
Definition:
Table.php:16
Magento\Framework\DB\Ddl\Table\TIMESTAMP_UPDATE
const TIMESTAMP_UPDATE
Definition:
Table.php:67
Magento\Framework\Setup\SchemaListenerDefinition\TimestampDefinition\convertToDefinition
convertToDefinition(array $definition)
Definition:
TimestampDefinition.php:19