first
This commit is contained in:
61
kernel/app_modules/event/models/EventContact.php
Normal file
61
kernel/app_modules/event/models/EventContact.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\app_modules\event\models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// Добавить @property
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $status
|
||||
* @property int $event_id
|
||||
* @property string $title
|
||||
* @property string $type
|
||||
*/
|
||||
class EventContact extends Model
|
||||
{
|
||||
const DISABLE_STATUS = 0;
|
||||
const ACTIVE_STATUS = 1;
|
||||
|
||||
const TYPE_EMAIL = 'email';
|
||||
const TYPE_PHONE = 'phone';
|
||||
const TYPE_TG = 'tg';
|
||||
|
||||
protected $table = 'event_contact';
|
||||
|
||||
protected $fillable = ['title', 'type', 'event_id', 'status']; // Заполнить массив. Пример: ['label', 'slug', 'status']
|
||||
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Название',
|
||||
'type' => 'Тип',
|
||||
'event_id' => 'Мероприятие',
|
||||
'status' => 'Статус',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getStatus(): array
|
||||
{
|
||||
return [
|
||||
self::DISABLE_STATUS => "Не активный",
|
||||
self::ACTIVE_STATUS => "Активный",
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getTypes(): array
|
||||
{
|
||||
return [
|
||||
self::TYPE_EMAIL => "Email",
|
||||
self::TYPE_PHONE => "Телефон",
|
||||
self::TYPE_TG => "Телеграм",
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user