method
public
IntegerField::cast()
Сигнатура
public cast(mixed $value) : SqlExpression|int
Описание
Строго приводит значение к типу поля.
Параметры
$value
mixed
Возвращаемое значение
SqlExpression|int
Как применяется в IntegerField
IntegerField::cast() — метод класса \Bitrix\Main\ORM\Fields\IntegerField модуля «Главный модуль». IntegerField: Класс поля сущности для типа данных integer.
Метод объекта: сначала нужен экземпляр IntegerField.
use Bitrix\Main\ORM\Fields\IntegerField;
/** @var IntegerField $object */
$value = null;
$result = $object->cast($value);
// $result: SqlExpression|intДругие методы IntegerField
addFetchDataModifier()addSaveDataModifier()addValidator()configureAutocomplete()configureBinary()configureColumnName()configureDefaultValue()configureFulltext()configureNullable()configurePrimary()configurePrivate()configureRequired()
cast() есть и у других классов модуля «Главный модуль»: ArrayField, BooleanField, CryptoField, DateField, DatetimeField, DecimalField, EnumField, ExpressionField.
Исходный файл: source/main/lib/orm/fields/integerfield.php:67

