re-written exporter for simpler extendability (#1349)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Invoice\InvoiceItemInterface;
|
||||
use App\Export\ExportItemInterface;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
@@ -39,8 +39,11 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* columns={"start_time","end_time"} => IDX_4F60C6B1502DF58741561401 => ???
|
||||
* columns={"start_time","end_time","user"} => IDX_4F60C6B1502DF587415614018D93D649 => ???
|
||||
*/
|
||||
class Timesheet implements EntityWithMetaFields, InvoiceItemInterface
|
||||
class Timesheet implements EntityWithMetaFields, ExportItemInterface
|
||||
{
|
||||
public const TYPE_TIMESHEET = 'timesheet';
|
||||
public const CATEGORY_WORK = 'work';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
@@ -385,7 +388,7 @@ class Timesheet implements EntityWithMetaFields, InvoiceItemInterface
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTagsAsArray()
|
||||
public function getTagsAsArray(): array
|
||||
{
|
||||
return array_map(
|
||||
function (Tag $element) {
|
||||
@@ -437,6 +440,18 @@ class Timesheet implements EntityWithMetaFields, InvoiceItemInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
// this will be improved in a future version
|
||||
return self::TYPE_TIMESHEET;
|
||||
}
|
||||
|
||||
public function getCategory(): string
|
||||
{
|
||||
// this will be improved in a future version
|
||||
return self::CATEGORY_WORK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
|
||||
Reference in New Issue
Block a user