This commit is contained in:
2025-06-18 14:50:18 +03:00
parent a64ed080bb
commit 4c716a8a8c
160 changed files with 6786 additions and 23 deletions

View File

@ -0,0 +1,57 @@
<?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');
}
}