File: D:/HostingSpaces/SBogers10/hours.komma.pro/app/Komma/Excel/Types/Row/AbstractTypeRow.php
<?php
namespace App\Komma\Excel\Types\Row;
abstract class AbstractTypeRow
{
/**
* Get the attributes of the excel row
*
* @return array
*/
public static function getAttributes(): array
{
return array_keys(get_class_vars(static::class));
}
/**
* Get the value of the row
*
* @param string $attribute
* @return mixed
*/
public function getValue(string $attribute)
{
switch ($attribute) {
case 'date':
return $this->{$attribute}->format('d-m-Y');
case 'user':
return $this->{$attribute}->name;
case 'billable':
case 'billed':
case 'bug':
return $this->{$attribute} ? 'Ja' : 'Nee';
default:
return $this->{$attribute};
}
}
abstract function hasStyling() :bool;
}