Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sequence.php
1
<?php
2
namespace
Bitrix\Perfmon\Sql
;
3
4
class
Sequence
extends
BaseObject
5
{
15
public
static
function
create
(
Tokenizer
$tokenizer)
16
{
17
$name
= $tokenizer->getCurrentToken()->text;
18
$sequence =
new
self
(
$name
);
19
20
$tokenizer->
resetState
();
21
$definition =
''
;
22
while
(!$tokenizer->
endOfInput
())
23
{
24
$definition .= $tokenizer->getCurrentToken()->text;
25
$tokenizer->nextToken();
26
}
27
28
$sequence->setBody($definition);
29
30
return
$sequence;
31
}
32
40
public
function
getCreateDdl
($dbType =
''
)
41
{
42
if
($dbType ===
'ORACLE'
)
43
{
44
return
$this->body
;
45
}
46
else
47
{
48
return
'// '
. get_class($this) .
':getDropDdl for database type ['
. $dbType .
'] not implemented'
;
49
}
50
}
51
59
public
function
getDropDdl
($dbType =
''
)
60
{
61
if
($dbType ===
'ORACLE'
)
62
{
63
return
'DROP SEQUENCE '
.
$this->name
;
64
}
65
else
66
{
67
return
'// '
. get_class($this) .
':getDropDdl for database type ['
. $dbType .
'] not implemented'
;
68
}
69
}
70
79
public
function
getModifyDdl
(
BaseObject
$target, $dbType =
''
)
80
{
81
if
($dbType ===
'ORACLE'
)
82
{
83
return
[
84
$this->
getDropDdl
($dbType),
85
$target->
getCreateDdl
($dbType),
86
];
87
}
88
else
89
{
90
return
'// '
. get_class($this) .
':getDropDdl for database type ['
. $dbType .
'] not implemented'
;
91
}
92
}
93
}
Bitrix\Perfmon\Sql\BaseObject
Definition
base_object.php:10
Bitrix\Perfmon\Sql\BaseObject\getCreateDdl
getCreateDdl($dbType='')
Definition
base_object.php:172
Bitrix\Perfmon\Sql\BaseObject\$body
$body
Definition
base_object.php:14
Bitrix\Perfmon\Sql\BaseObject\$name
$name
Definition
base_object.php:13
Bitrix\Perfmon\Sql\Sequence
Definition
sequence.php:5
Bitrix\Perfmon\Sql\Sequence\getCreateDdl
getCreateDdl($dbType='')
Definition
sequence.php:40
Bitrix\Perfmon\Sql\Sequence\create
static create(Tokenizer $tokenizer)
Definition
sequence.php:15
Bitrix\Perfmon\Sql\Sequence\getModifyDdl
getModifyDdl(BaseObject $target, $dbType='')
Definition
sequence.php:79
Bitrix\Perfmon\Sql\Sequence\getDropDdl
getDropDdl($dbType='')
Definition
sequence.php:59
Bitrix\Perfmon\Sql\Tokenizer
Definition
tokenizer.php:66
Bitrix\Perfmon\Sql\Tokenizer\endOfInput
endOfInput()
Definition
tokenizer.php:159
Bitrix\Perfmon\Sql\Tokenizer\resetState
resetState()
Definition
tokenizer.php:117
Bitrix\Perfmon\Sql
Definition
base_object.php:2
modules
perfmon
lib
sql
sequence.php
Создано системой
1.10.0