38 lines
926 B
PHP
38 lines
926 B
PHP
<?php
|
|
|
|
namespace App\Domain\Catalog;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ResolvedScope extends Model
|
|
{
|
|
protected $fillable = [
|
|
'offer_version_id',
|
|
'license_article_id',
|
|
'rights_profile_version_id',
|
|
];
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::updating(function (): void {
|
|
throw new DomainRuleException('Der aufgelöste Leistungsumfang einer Angebotsfassung ist unveränderlich.');
|
|
});
|
|
}
|
|
|
|
public function offerVersion(): BelongsTo
|
|
{
|
|
return $this->belongsTo(OfferVersion::class);
|
|
}
|
|
|
|
public function article(): BelongsTo
|
|
{
|
|
return $this->belongsTo(LicenseArticle::class, 'license_article_id');
|
|
}
|
|
|
|
public function rights(): BelongsTo
|
|
{
|
|
return $this->belongsTo(RightsProfileVersion::class, 'rights_profile_version_id');
|
|
}
|
|
}
|