- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/internals/rights/table/rightsetupsession.php
- Класс: BitrixDiskInternalsRightsTableRightSetupSessionTable
- Вызов: RightSetupSessionTable::getMap
static function getMap()
{
$sqlHelper = Application::getConnection()->getSqlHelper();
$deathTime = $sqlHelper->addSecondsToDateTime(self::LIFETIME_SECONDS, 'CREATE_TIME');
$now = $sqlHelper->getCurrentDateTimeFunction();
return array(
'ID' => array(
'data_type' => 'integer',
'primary' => true,
'autocomplete' => true,
),
'PARENT_ID' => array(
'data_type' => 'integer',
),
'PARENT' => array(
'data_type' => 'BitrixDiskInternalsRightsTableRightSetupSessionTable',
'reference' => array(
'=this.PARENT_ID' => 'ref.ID'
),
),
'OBJECT_ID' => array(
'data_type' => 'integer',
'required' => true,
),
'OBJECT' => array(
'data_type' => 'BitrixDiskInternalsObjectTable',
'reference' => array(
'=this.OBJECT_ID' => 'ref.ID'
),
'join_type' => 'INNER',
),
'STATUS' => array(
'data_type' => 'integer',
'default_value' => self::STATUS_STARTED,
),
'CREATE_TIME' => array(
'data_type' => 'datetime',
'default_value' => function() {
return new DateTime();
},
'required' => true,
),
'IS_EXPIRED' => array(
'data_type' => 'boolean',
'expression' => array(
"CASE WHEN ({$now} > {$deathTime}) THEN 1 ELSE 0 END"
),
'values' => array(0, 1),
),
'CREATED_BY' => array(
'data_type' => 'integer',
),
);
}