toby/app/Eloquent/Models/VacationLimit.php
Adrian Hopek cc981b02b4
#90 - user profile (#125)
* fix css focuses

* #90 - wip

* #90 - fix to generate PDF

* #90 - wip

* #90 - wip

* #90 - wip

* #90 - wip

* #90 - fix to calendar

* #90 - wip

* #90 - fix

* #90 - fix lint

* #90 - fix

* Apply suggestions from code review

Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>

* #90 - cr fixes

* #90 - fix

Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
2022-04-14 11:58:45 +02:00

44 lines
879 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Eloquent\Models;
use Database\Factories\VacationLimitFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property User $user
* @property YearPeriod $yearPeriod
* @property int $days
*/
class VacationLimit extends Model
{
use HasFactory;
protected $guarded = [];
public function hasVacation(): bool
{
return $this->days !== null;
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function yearPeriod(): BelongsTo
{
return $this->belongsTo(YearPeriod::class);
}
protected static function newFactory(): VacationLimitFactory
{
return VacationLimitFactory::new();
}
}