| Total Complexity | 7 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ProfitTransfer extends Base |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The table associated with the model. |
||
| 14 | * |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $table = 'v_profit_transfers'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Indicates if the model should be timestamped. |
||
| 21 | * |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | public $timestamps = false; |
||
| 25 | |||
| 26 | public function fund() |
||
| 27 | { |
||
| 28 | return $this->belongsTo(Fund::class); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function session() |
||
| 32 | { |
||
| 33 | return $this->belongsTo(Session::class); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function member() |
||
| 37 | { |
||
| 38 | return $this->belongsTo(Member::class); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function type(): Attribute |
||
| 42 | { |
||
| 43 | return Attribute::make( |
||
| 44 | get: fn() => trans($this->coef > 0 ? |
||
|
|
|||
| 45 | 'meeting.labels.saving' : 'meeting.labels.settlement'), |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param Builder $query |
||
| 51 | * @param Fund $fund |
||
| 52 | * |
||
| 53 | * @return Builder |
||
| 54 | */ |
||
| 55 | public function scopeWhereFund(Builder $query, Fund $fund): Builder |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param Builder $query |
||
| 62 | * @param Session $session |
||
| 63 | * |
||
| 64 | * @return Builder |
||
| 65 | */ |
||
| 66 | public function scopeWhereSession(Builder $query, Session $session): Builder |
||
| 69 | } |
||
| 70 | } |
||
| 71 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.