1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
inttype.php
См. документацию.
1<?php
2namespace Bitrix\Bizproc\BaseType;
3
4use Bitrix\Main\Localization\Loc;
5use Bitrix\Bizproc\FieldType;
6
7Loc::loadMessages(__FILE__);
8
13class IntType extends Double
14{
15
19 public static function getType()
20 {
21 return FieldType::INT;
22 }
23
31 public static function toSingleValue(FieldType $fieldType, $value)
32 {
33 if (is_array($value))
34 {
35 reset($value);
36 $value = current($value);
37 }
38 return $value;
39 }
40
47 protected static function extractValue(FieldType $fieldType, array $field, array $request)
48 {
49 $value = Base::extractValue($fieldType, $field, $request);
50
51 if ($value !== null && is_string($value) && $value <> '')
52 {
53 if (\CBPActivity::isExpression($value))
54 return $value;
55
56 $value = str_replace(' ', '', $value);
57 if (preg_match('#^[0-9\-]+$#', $value))
58 {
59 $value = (int) $value;
60 }
61 else
62 {
63 $value = null;
64 static::addError(array(
65 'code' => 'ErrorValue',
66 'message' => Loc::getMessage('BPDT_INT_INVALID'),
67 'parameter' => static::generateControlName($field),
68 ));
69 }
70 }
71 elseif (is_numeric($value))
72 {
73 $value = (int)$value;
74 }
75 else
76 {
77 $value = null;
78 }
79
80 return $value;
81 }
82}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
static extractValue(FieldType $fieldType, array $field, array $request)
Определения base.php:645
static getType()
Определения inttype.php:19
static extractValue(FieldType $fieldType, array $field, array $request)
Определения inttype.php:47
static toSingleValue(FieldType $fieldType, $value)
Определения inttype.php:31
const INT
Определения fieldtype.php:42
static isExpression($text)
Определения activity.php:1718
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393