• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/internals/tmpfile.php
  • Класс: BitrixDiskInternalsTmpFileTable
  • Вызов: TmpFileTable::getMap
static function getMap()
{
	$date = new DateTime();
	$yesterday = Application::getConnection()
		->getSqlHelper()
		->getCharToDateFunction($date->add('-1 DAY')->format("Y-m-d H:i:s"));

	return array(
		'ID' => array(
			'data_type' => 'integer',
			'primary' => true,
			'autocomplete' => true,
		),
		'TOKEN' => array(
			'data_type' => 'string',
			'required' => true,
			'validation' => array(__CLASS__, 'validateToken'),
		),
		'FILENAME' => array(
			'data_type' => 'string',
			'validation' => array(__CLASS__, 'validateFilename'),
		),
		'CONTENT_TYPE' => array(
			'data_type' => 'string',
			'validation' => array(__CLASS__, 'validateContentType'),
		),
		'PATH' => array(
			'data_type' => 'string',
			'required' => true,
			'validation' => array(__CLASS__, 'validatePath'),
		),
		'BUCKET_ID' => array(
			'data_type' => 'integer',
		),
		'SIZE' => array(
			'data_type' => 'integer',
		),
		'RECEIVED_SIZE' => array(
			'data_type' => 'integer',
		),
		'WIDTH' => array(
			'data_type' => 'integer',
		),
		'HEIGHT' => array(
			'data_type' => 'integer',
		),
		'IS_CLOUD' => array(
			'data_type' => 'boolean',
			'values' => array(0, 1),
			'default_value' => 0,
		),
		'IRRELEVANT' => array(
			'data_type' => 'boolean',
			'expression' => array(
				"CASE WHEN (%s < {$yesterday}) THEN 1 ELSE 0 END",
				'CREATE_TIME',
			),
			'values' => array(0, 1),
		),
		'CREATED_BY' => array(
			'data_type' => 'integer',
		),
		'CREATE_USER' => array(
			'data_type' => 'BitrixMainUserTable',
			'reference' => array(
				'=this.CREATED_BY' => 'ref.ID'
			),
		),
		'CREATE_TIME' => array(
			'data_type' => 'datetime',
			'required' => true,
			'default_value' => function() {
				return new DateTime();
			},
		),
	);
}