3namespace Bitrix\Im\Model;
5use Bitrix\Im\Call\Call;
6use Bitrix\Main\Application;
7use Bitrix\Main\Type\DateTime;
8use Bitrix\Main\ORM\Query\Join;
9use Bitrix\Main\ORM\Data\DataManager;
10use Bitrix\Main\ORM\Fields\StringField;
11use Bitrix\Main\ORM\Fields\IntegerField;
12use Bitrix\Main\ORM\Fields\DatetimeField;
13use Bitrix\Main\ORM\Fields\BooleanField;
14use Bitrix\Main\ORM\Fields\EnumField;
15use Bitrix\Main\ORM\Fields\Relations\Reference;
45 ->configureAutocomplete(),
50 ->configureValues([Call::SCHEME_CLASSIC, Call::SCHEME_JWT])
52 ->configureNullable(),
57 ->configureDefaultValue(
'N'),
75 ->configureDefaultValue(fn() =>
new DateTime()),
92 ->configureValues(
'N',
'Y')
96 ->configureValues(
'N',
'Y')
97 ->configureDefaultValue(
'N'),
99 (
new Reference(
'CALL_USER',CallUserTable::class,
100 Join::on(
'this.ID',
'ref.CALL_ID')))
101 ->configureJoinType(Join::TYPE_INNER),
111 public static function updateState(
int $id,
string $newState) : bool
115 $tableName = static::getTableName();
116 $newState = $sqlHelper->forSql($newState);
118 $update =
"STATE = '$newState'";
119 if($newState === Call::STATE_FINISHED)
121 $update .=
", END_DATE = CURRENT_TIMESTAMP";
131 AND STATE != '$newState'
static updateState(int $id, string $newState)
configureDefaultValue($value)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)