Files
gestalt/kernel/app_modules/event/models/EventContact.php
2025-06-18 14:50:18 +03:00

61 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 => "Телеграм",
];
}
}