files, dead line
This commit is contained in:
@@ -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 => "Не активен",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user