Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mysqlsqlhelper.php
1<?php
2namespace Bitrix\Main\DB;
3
5
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}
getFieldByColumnType($name, $type, array $parameters=null)
forSql($value, $maxLength=0)