2025-01-19 17:15:58 +03:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace kernel\app_modules\card\models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @property int $id;
|
|
|
|
|
* @property string $slug;
|
|
|
|
|
* @property string $title;
|
|
|
|
|
* @property int $status;
|
|
|
|
|
*/
|
|
|
|
|
class CardProgram extends Model
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
const DISABLE_STATUS = 0;
|
|
|
|
|
const ACTIVE_STATUS = 1;
|
|
|
|
|
|
|
|
|
|
protected $table = 'card_program';
|
|
|
|
|
|
|
|
|
|
protected $fillable = ['slug', 'title', 'status'];
|
|
|
|
|
|
|
|
|
|
public static function labels(): array
|
|
|
|
|
{
|
|
|
|
|
// Заполнить массив
|
|
|
|
|
// Пример: [
|
|
|
|
|
// 'label' => 'Заголовок',
|
|
|
|
|
// 'entity' => 'Сущность',
|
|
|
|
|
// 'slug' => 'Slug',
|
|
|
|
|
// 'status' => 'Статус',
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'slug' => 'Slug',
|
|
|
|
|
'title' => 'Название',
|
|
|
|
|
'status' => 'Статус',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-26 14:42:47 +03:00
|
|
|
|
public function cardProgramConditions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(CardProgramConditions::class);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-19 17:15:58 +03:00
|
|
|
|
/**
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
public static function getStatus(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
self::DISABLE_STATUS => "Не активный",
|
|
|
|
|
self::ACTIVE_STATUS => "Активный",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|