Files
CRM/app/Models/Instance/Emotion/PrimaryEmotion.php
Kroonk a213a1dba0
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
refactor: replace custom CRM with Monica fork
2026-05-22 16:19:55 +02:00

45 lines
968 B
PHP

<?php
namespace App\Models\Instance\Emotion;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* An emotion (ex: Adoration) is defined into 3 categories:
* - Primary: Love
* - Secondary: Affection
* - Tertiary: Adoration.
*/
class PrimaryEmotion extends Model
{
protected $table = 'emotions_primary';
/**
* The attributes that aren't mass assignable.
*
* @var array<string>|bool
*/
protected $guarded = ['id'];
/**
* Get the emotion records associated with the primary emotion.
*
* @return HasMany
*/
public function emotions()
{
return $this->hasMany(Emotion::class, 'emotion_primary_id');
}
/**
* Get the secondary records associated with the primary emotion.
*
* @return HasMany
*/
public function secondaries()
{
return $this->hasMany(SecondaryEmotion::class, 'emotion_primary_id');
}
}