static function getMap()
{
$connection = Application::getConnection();
$now = $connection->getSqlHelper()->getCurrentDateTimeFunction();
return array(
'ID' => array(
'data_type' => 'integer',
'primary' => true,
'autocomplete' => true,
),
'OBJECT_ID' => array(
'data_type' => 'integer',
'required' => true,
),
'OBJECT' => array(
'data_type' => 'BitrixDiskInternalsObjectTable',
'reference' => array(
'=this.OBJECT_ID' => 'ref.ID'
),
),
'VERSION_ID' => array(
'data_type' => 'integer',
),
'VERSION' => array(
'data_type' => 'BitrixDiskInternalsVersionTable',
'reference' => array(
'=this.OBJECT_ID' => 'ref.ID'
),
),
'HASH' => array(
'data_type' => 'string',
'required' => true,
'validation' => array(__CLASS__, 'validateHash'),
),
'PASSWORD' => array(
'data_type' => 'string',
'validation' => array(__CLASS__, 'validatePassword'),
),
'SALT' => array(
'data_type' => 'string',
'validation' => array(__CLASS__, 'validateSalt'),
),
'DEATH_TIME' => array(
'data_type' => 'datetime',
),
'DESCRIPTION' => array(
'data_type' => 'text',
),
'DOWNLOAD_COUNT' => array(
'data_type' => 'integer',
'default_value' => 0,
),
'ACCESS_RIGHT' => array(
'data_type' => 'integer',
'default_value' => self::ACCESS_RIGHT_VIEW,
),
'IS_EXPIRED' => array(
'data_type' => 'boolean',
'expression' => array(
"CASE WHEN (%s IS NOT NULL AND %s > {$now} OR %s IS NULL) THEN 0 ELSE 1 END",
'DEATH_TIME', 'DEATH_TIME', 'DEATH_TIME'
),
'values' => array(0, 1),
),
'TYPE' => array(
'data_type' => 'enum',
'required' => true,
'values' => static::getListOfTypeValues(),
),
'CREATE_TIME' => array(
'data_type' => 'datetime',
'required' => true,
'default_value' => function() {
return new DateTime();
},
),
'CREATED_BY' => array(
'data_type' => 'integer',
),
'CREATE_USER' => array(
'data_type' => 'BitrixMainUserTable',
'reference' => array(
'=this.CREATED_BY' => 'ref.ID'
),
),
);
}