files, dead line

This commit is contained in:
2023-06-30 18:13:40 +03:00
parent f861f3eea9
commit 567ab20361
7 changed files with 232 additions and 4 deletions

View File

@@ -21,6 +21,9 @@ use yii\db\Expression;
*/
class FileEntity extends \yii\db\ActiveRecord
{
const STATUS_ACTIVE = 1;
const STATUS_DISABLE = 0;
public function behaviors()
{
return [
@@ -33,6 +36,20 @@ class FileEntity extends \yii\db\ActiveRecord
];
}
public function fields(): array
{
return [
'id',
'file_id',
'file',
'entity_type',
'entity_id',
'created_at',
'updated_at',
'status',
];
}
/**
* {@inheritdoc}
*/
@@ -76,4 +93,15 @@ class FileEntity extends \yii\db\ActiveRecord
{
return $this->hasOne(File::className(), ['id' => 'file_id']);
}
/**
* @return string[]
*/
public static function getStatusList(): array
{
return [
self::STATUS_ACTIVE => "Активен",
self::STATUS_DISABLE => "Не активен",
];
}
}