HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/hours.komma.pro/app/Komma/Excel/Types/Row/AbsenceRow.php
<?php

namespace App\Komma\Excel\Types\Row;

use App\Komma\Absences\Absence;
use App\Komma\Subprojects\Subproject;
use App\Komma\Users\User;
use Carbon\Carbon;

class AbsenceRow extends AbstractTypeRow
{

    public string $description;
    public float $hours;
    public Carbon $date;
    public User $user;
    public bool $billed;

    public function __construct(Absence $absence)
    {
        $this->extractAttributesFromAbsence($absence);
    }

    /**
     * Map the direct values of the Absence
     *
     * @param  Subproject  $subproject
     */
    private function extractAttributesFromAbsence(Absence $absence)
    {
        $this->description = $absence->description;
        $this->hours = $absence->value;
        $this->date = $absence->date;
        $this->user = $absence->user;
        $this->billed = $absence->payed;
    }

    /**
     * Check if row has any styling rules
     *
     * @return bool
     */
    function hasStyling(): bool
    {
        return false;
    }
}