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

57 lines
1.5 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\gestalt_profile_relationship\models;
use Illuminate\Database\Eloquent\Model;
use kernel\app_modules\gestalt_profile\models\Gestalt_profile;
// Добавить @property
/**
* @property int $id
* @property int $gestalt_profile_id
* @property int $entity_id
* @property string $entity
*/
class GestaltProfileRelationship extends Model
{
const DISABLE_STATUS = 0;
const ACTIVE_STATUS = 1;
protected $table = 'gestalt_profile_relationship';
protected $fillable = ['gestalt_profile_id', 'entity', 'entity_id'];
public static function labels(): array
{
// Заполнить массив
// Пример: [
// 'label' => 'Заголовок',
// 'entity' => 'Сущность',
// 'slug' => 'Slug',
// 'status' => 'Статус',
// ]
return [
'gestalt_profile_id' => 'Профиль',
'entity' => 'Сущность',
'entity_id' => 'ID сущности',
];
}
/**
* @return string[]
*/
public static function getStatus(): array
{
return [
self::DISABLE_STATUS => "Не активный",
self::ACTIVE_STATUS => "Активный",
];
}
public function profile(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Gestalt_profile::class, 'gestalt_profile_id');
}
}