Ergänze das U1-Fachmodell für Inhalt, Paket und Angebot.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2035c46edd
commit
2ded4b7fad
35 files changed
+2115
No files matched your search
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Entitlement;
|
||||
|
||||
use App\Domain\Catalog\ArticleRelease;
|
||||
use App\Domain\Catalog\LicenseArticle;
|
||||
use App\Domain\Catalog\RightsProfileVersion;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Grant extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'acquisition_id',
|
||||
'license_article_id',
|
||||
'rights_profile_version_id',
|
||||
'rights_snapshot',
|
||||
'valid_from',
|
||||
'valid_until',
|
||||
'release_at_grant_id',
|
||||
'status',
|
||||
'status_reason',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'rights_snapshot' => 'array',
|
||||
'valid_from' => 'datetime',
|
||||
'valid_until' => 'datetime',
|
||||
'status' => GrantStatus::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function acquisition(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Acquisition::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');
|
||||
}
|
||||
|
||||
public function releaseAtGrant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ArticleRelease::class, 'release_at_grant_id');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user