mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-03 22:01:00 +00:00
chore(metadata): remove legacy-era metadata sources
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Metadata\Models;
|
||||
|
||||
use App\Domains\Accounts\Models\Company;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class CustomFieldValue extends Model
|
||||
{
|
||||
protected $table = 'custom_field_values';
|
||||
|
||||
use HasFactory;
|
||||
|
||||
protected $dates = [
|
||||
'date_answer',
|
||||
'date_time_answer',
|
||||
];
|
||||
|
||||
protected $guarded = [
|
||||
'id',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'defaultAnswer',
|
||||
];
|
||||
|
||||
public function setTimeAnswerAttribute(mixed $value): void
|
||||
{
|
||||
if ($value && $value != null) {
|
||||
$this->attributes['time_answer'] = date('H:i:s', strtotime($value));
|
||||
} else {
|
||||
$this->attributes['time_answer'] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefaultAnswerAttribute()
|
||||
{
|
||||
$value_type = getCustomFieldValueKey($this->type);
|
||||
|
||||
return $this->$value_type;
|
||||
}
|
||||
|
||||
public function company(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
public function customField(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(CustomField::class);
|
||||
}
|
||||
|
||||
public function customFieldValuable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user