Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
base_object.php
1
<?php
2
namespace
Bitrix\Perfmon\Sql
;
3
9
abstract
class
BaseObject
10
{
12
public
$parent
=
null
;
13
public
$name
=
''
;
14
public
$body
=
''
;
15
protected
$ciName
=
''
;
16
20
public
function
__construct
(
$name
=
''
)
21
{
22
$this->name = (string)
$name
;
23
$this->ciName = static::getCompareName($this->name);
24
}
25
33
public
function
setBody
(
$body
)
34
{
35
$this->body = trim(
$body
);
36
return
$this;
37
}
38
48
public
function
setParent
(
BaseObject
$parent
=
null
)
49
{
50
$this->parent =
$parent
;
51
return
$this;
52
}
53
61
final
public
function
getUnquotedName
(
$name
=
null
)
62
{
63
if
(
$name
===
null
&& $this->name)
64
{
65
return
$this->
getUnquotedName
($this->name);
66
}
67
elseif (is_array(
$name
))
68
{
69
foreach
(
$name
as $key => $value)
70
{
71
$name
[$key] = $this->
getUnquotedName
($value);
72
}
73
}
74
elseif (
$name
[0] ==
'`'
)
75
{
76
$name
= trim(
$name
,
'`'
);
77
}
78
elseif (
$name
[0] ==
'"'
)
79
{
80
$name
= trim(
$name
,
'"'
);
81
}
82
elseif (
$name
[0] ==
'['
)
83
{
84
$name
= trim(
$name
,
'[]'
);
85
}
86
return
$name
;
87
}
88
96
final
public
function
getLowercasedName
()
97
{
98
if
($this->name[0] ==
'`'
)
99
{
100
return
$this->name
;
101
}
102
elseif ($this->name[0] ==
'"'
)
103
{
104
return
$this->name
;
105
}
106
elseif ($this->name[0] ==
'['
)
107
{
108
return
$this->name
;
109
}
110
else
111
{
112
return
mb_strtolower($this->name);
113
}
114
}
115
124
final
public
static
function
getCompareName
(
$name
)
125
{
126
if
(
$name
)
127
{
128
if
(
$name
[0] ==
'`'
)
129
{
130
return
substr(
$name
, 1, -1);
131
}
132
elseif (
$name
[0] ==
'"'
)
133
{
134
return
substr(
$name
, 1, -1);
135
}
136
elseif (
$name
[0] ==
'['
)
137
{
138
return
substr(
$name
, 1, -1);
139
}
140
else
141
{
142
return
mb_strtoupper(
$name
);
143
}
144
}
145
else
146
{
147
return
$name
;
148
}
149
}
150
160
final
public
function
compareName
(
$name
)
161
{
162
return
strcmp($this->ciName, static::getCompareName(
$name
));
163
}
164
172
public
function
getCreateDdl
($dbType =
''
)
173
{
174
return
'// '
. get_class($this) .
':getCreateDdl not implemented'
;
175
}
176
184
public
function
getDropDdl
($dbType =
''
)
185
{
186
return
'// '
. get_class($this) .
':getDropDdl not implemented'
;
187
}
188
197
public
function
getModifyDdl
(
BaseObject
$target, $dbType =
''
)
198
{
199
return
'// '
. get_class($this) .
':getModifyDdl not implemented'
;
200
}
201
}
Bitrix\Perfmon\Sql\BaseObject
Definition
base_object.php:10
Bitrix\Perfmon\Sql\BaseObject\setBody
setBody($body)
Definition
base_object.php:33
Bitrix\Perfmon\Sql\BaseObject\getCreateDdl
getCreateDdl($dbType='')
Definition
base_object.php:172
Bitrix\Perfmon\Sql\BaseObject\$ciName
$ciName
Definition
base_object.php:15
Bitrix\Perfmon\Sql\BaseObject\getUnquotedName
getUnquotedName($name=null)
Definition
base_object.php:61
Bitrix\Perfmon\Sql\BaseObject\$body
$body
Definition
base_object.php:14
Bitrix\Perfmon\Sql\BaseObject\compareName
compareName($name)
Definition
base_object.php:160
Bitrix\Perfmon\Sql\BaseObject\__construct
__construct($name='')
Definition
base_object.php:20
Bitrix\Perfmon\Sql\BaseObject\getModifyDdl
getModifyDdl(BaseObject $target, $dbType='')
Definition
base_object.php:197
Bitrix\Perfmon\Sql\BaseObject\$parent
$parent
Definition
base_object.php:12
Bitrix\Perfmon\Sql\BaseObject\setParent
setParent(BaseObject $parent=null)
Definition
base_object.php:48
Bitrix\Perfmon\Sql\BaseObject\$name
$name
Definition
base_object.php:13
Bitrix\Perfmon\Sql\BaseObject\getDropDdl
getDropDdl($dbType='')
Definition
base_object.php:184
Bitrix\Perfmon\Sql\BaseObject\getLowercasedName
getLowercasedName()
Definition
base_object.php:96
Bitrix\Perfmon\Sql\BaseObject\getCompareName
static getCompareName($name)
Definition
base_object.php:124
Bitrix\Perfmon\Sql
Definition
base_object.php:2
modules
perfmon
lib
sql
base_object.php
Создано системой
1.10.0