-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMorphBasicConsumer.php
34 lines (28 loc) · 1.07 KB
/
MorphBasicConsumer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace romanzipp\ProjectableAggregates\Tests\Support;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use romanzipp\ProjectableAggregates\Attributes\ConsumesProjectableAggregate;
use romanzipp\ProjectableAggregates\Contracts\ConsumesProjectableAggregatesContract;
use romanzipp\ProjectableAggregates\ProjectionAggregateType;
/**
* @property int $id
* @property int $projection_providers_count
*/
class MorphBasicConsumer extends Model implements ConsumesProjectableAggregatesContract
{
public $table = 'basic_morph_consumers';
public $timestamps = false;
protected $guarded = [];
/**
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\romanzipp\ProjectableAggregates\Tests\Support\MorphBasicProvider, $this>
*/
#[ConsumesProjectableAggregate(
projectionAttribute: 'projection_providers_count',
type: ProjectionAggregateType::TYPE_COUNT,
)]
public function providers(): MorphMany
{
return $this->morphMany(MorphBasicProvider::class, 'consumer');
}
}