2024-10-15 17:32:33 +03:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\modules\module_shop\models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
2024-10-16 16:06:25 +03:00
|
|
|
|
/**
|
|
|
|
|
* @property int $id
|
|
|
|
|
* @property string $name
|
|
|
|
|
* @property string $slug
|
|
|
|
|
* @property string $version
|
|
|
|
|
* @property string $description
|
|
|
|
|
* @property string $author
|
|
|
|
|
* @property int $status
|
2024-10-25 15:47:11 +03:00
|
|
|
|
* @property int $installations
|
|
|
|
|
* @property int $views
|
2024-10-16 16:06:25 +03:00
|
|
|
|
* @property string $path_to_archive
|
|
|
|
|
* @property string $dependence
|
|
|
|
|
*/
|
2024-10-15 17:32:33 +03:00
|
|
|
|
class ModuleShop extends Model
|
|
|
|
|
{
|
|
|
|
|
const DISABLE_STATUS = 0;
|
|
|
|
|
const ACTIVE_STATUS = 1;
|
|
|
|
|
|
|
|
|
|
protected $table = "module_shop";
|
|
|
|
|
|
2024-10-25 15:47:11 +03:00
|
|
|
|
protected $fillable = ['name', 'slug', 'version', 'description', 'author', 'status', 'dependence', 'installations', 'views'];
|
2024-10-15 17:32:33 +03:00
|
|
|
|
|
|
|
|
|
public static function labels(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name' => 'Название',
|
|
|
|
|
'version' => 'Версия',
|
|
|
|
|
'description' => 'Описание',
|
|
|
|
|
'author' => 'Автор',
|
|
|
|
|
'status' => 'Статус',
|
|
|
|
|
'slug' => 'Slug',
|
|
|
|
|
'dependence' => 'Зависимости',
|
2024-10-25 15:47:11 +03:00
|
|
|
|
'installations' => 'Установки',
|
|
|
|
|
'views' => 'Просмотры',
|
2024-10-15 17:32:33 +03:00
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
public static function getStatus(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
self::DISABLE_STATUS => "Не активный",
|
|
|
|
|
self::ACTIVE_STATUS => "Активный",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|