Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
textfield.php
1
<?php
9
namespace
Bitrix\Main\ORM\Fields
;
10
11
use
Bitrix\Main\DB\SqlExpression
;
12
19
class
TextField
extends
StringField
20
{
22
protected
$long
=
false
;
23
32
function
__construct
(
$name
, $parameters = array())
33
{
34
parent::__construct(
$name
, $parameters);
35
36
$this->
long
= isset($parameters[
'long'
]) && (bool)$parameters[
'long'
];
37
}
38
44
public
function
configureLong
(
$long
=
true
)
45
{
46
$this->
long
= (bool)
$long
;
47
return
$this;
48
}
49
53
public
function
isLong
()
54
{
55
return
$this->long
;
56
}
57
64
public
function
convertValueFromDb
($value)
65
{
66
return
$this->
getConnection
()->getSqlHelper()->convertFromDbText($value);
67
}
68
75
public
function
convertValueToDb
($value)
76
{
77
if
($value instanceof
SqlExpression
)
78
{
79
return
$value;
80
}
81
82
return
$value ===
null
&& $this->is_nullable
83
? $value
84
: $this->
getConnection
()->getSqlHelper()->convertToDbText($value);
85
}
86
87
public
function
isValueEmpty
($value)
88
{
89
if
($this->
isSerialized
() && is_array($value))
90
{
91
return
false
;
92
}
93
94
return
parent::isValueEmpty($value);
95
}
96
}
Bitrix\Main\DB\SqlExpression
Definition
sqlexpression.php:19
Bitrix\Main\ORM\Fields\Field\$name
$name
Definition
field.php:27
Bitrix\Main\ORM\Fields\Field\isSerialized
isSerialized()
Definition
field.php:456
Bitrix\Main\ORM\Fields\Field\getConnection
getConnection()
Definition
field.php:626
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Definition
textfield.php:20
Bitrix\Main\ORM\Fields\TextField\isLong
isLong()
Definition
textfield.php:53
Bitrix\Main\ORM\Fields\TextField\configureLong
configureLong($long=true)
Definition
textfield.php:44
Bitrix\Main\ORM\Fields\TextField\$long
$long
Definition
textfield.php:22
Bitrix\Main\ORM\Fields\TextField\__construct
__construct($name, $parameters=array())
Definition
textfield.php:32
Bitrix\Main\ORM\Fields\TextField\convertValueFromDb
convertValueFromDb($value)
Definition
textfield.php:64
Bitrix\Main\ORM\Fields\TextField\isValueEmpty
isValueEmpty($value)
Definition
textfield.php:87
Bitrix\Main\ORM\Fields\TextField\convertValueToDb
convertValueToDb($value)
Definition
textfield.php:75
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
modules
main
lib
orm
fields
textfield.php
Создано системой
1.10.0