added tags for timesheets (#604)

This commit is contained in:
Mathias
2019-05-12 01:40:04 +02:00
committed by Kevin Papst
parent f31118292c
commit e29e183e84
84 changed files with 2132 additions and 158 deletions

View File

@@ -9,6 +9,7 @@
namespace App\Calendar;
use App\Entity\Tag;
use App\Entity\Timesheet;
class TimesheetEntity
@@ -45,6 +46,10 @@ class TimesheetEntity
* @var string
*/
protected $activity;
/**
* @var string|null
*/
protected $tags;
/**
* @var string|null
*/
@@ -66,6 +71,14 @@ class TimesheetEntity
$this->customer = $entry->getProject()->getCustomer()->getName();
$this->project = $entry->getProject()->getName();
$this->activity = $entry->getActivity()->getName();
if (sizeof($entry->getTags()) > 0) {
$arr = [];
/** @var Tag $tag */
foreach ($entry->getTags() as $tag) {
array_push($arr, $tag->getName());
}
$this->tags = implode(', ', $arr);
}
$color = $entry->getActivity()->getColor();
if (empty($color)) {
@@ -235,6 +248,25 @@ class TimesheetEntity
return $this;
}
/**
* @return string|null
*/
public function getTags(): ?string
{
return $this->tags;
}
/**
* @param string|null $tags
* @return TimesheetEntity
*/
public function setTags(?string $tags)
{
$this->tags = $tags;
return $this;
}
/**
* @return null|string
*/