Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
mysqlsqlhelper.php
1
<?php
2
namespace
Bitrix\Main\DB
;
3
4
use
Bitrix\Main\ORM
;
5
6
class
MysqlSqlHelper
extends
MysqlCommonSqlHelper
7
{
16
public
function
forSql
($value, $maxLength = 0)
17
{
18
if
($maxLength > 0)
19
$value = mb_substr($value, 0, $maxLength);
20
21
return
mysql_real_escape_string($value, $this->connection->getResource());
22
}
23
34
public
function
getFieldByColumnType
($name, $type, array $parameters =
null
)
35
{
36
switch
($type)
37
{
38
case
"int"
:
39
return
new
ORM\Fields\IntegerField
($name);
40
41
case
"real"
:
42
return
new
ORM\Fields\FloatField
($name);
43
44
case
"datetime"
:
45
case
"timestamp"
:
46
return
new
ORM\Fields\DatetimeField
($name);
47
48
case
"date"
:
49
return
new
ORM\Fields\DateField
($name);
50
}
51
return
new
ORM\Fields\StringField
($name);
52
}
53
}
Bitrix\Main\DB\MysqlCommonSqlHelper
Definition
mysqlcommonsqlhelper.php:10
Bitrix\Main\DB\MysqlSqlHelper
Definition
mysqlsqlhelper.php:7
Bitrix\Main\DB\MysqlSqlHelper\getFieldByColumnType
getFieldByColumnType($name, $type, array $parameters=null)
Definition
mysqlsqlhelper.php:34
Bitrix\Main\DB\MysqlSqlHelper\forSql
forSql($value, $maxLength=0)
Definition
mysqlsqlhelper.php:16
Bitrix\Main\ORM\Fields\DateField
Definition
datefield.php:24
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\FloatField
Definition
floatfield.php:20
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\DB
Definition
arrayresult.php:2
Bitrix\Main\ORM
modules
main
lib
db
mysqlsqlhelper.php
Создано системой
1.10.0