* dailystandup slide-lock function added
* doctrine hydrator immutable date types added
This commit is contained in:
parent
261c43086a
commit
176cbd86f0
@ -63,6 +63,24 @@ class Team implements JsonSerializable
|
|||||||
*/
|
*/
|
||||||
private $filterId;
|
private $filterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="daily_lock_enabled", type="boolean", options={"default" = false})
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $dailyLockEnabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="daily_start_time", type="time_immutable", nullable=true)
|
||||||
|
* @var \DateTimeImmutable
|
||||||
|
*/
|
||||||
|
private $dailyStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="daily_end_time", type="time_immutable", nullable=true)
|
||||||
|
* @var \DateTimeImmutable
|
||||||
|
*/
|
||||||
|
private $dailyEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(name="backlog_column", type="json", nullable=true)
|
* @ORM\Column(name="backlog_column", type="json", nullable=true)
|
||||||
* @var KanbanColumn
|
* @var KanbanColumn
|
||||||
@ -91,7 +109,7 @@ class Team implements JsonSerializable
|
|||||||
* @ORM\Column(name="is_active", type="boolean")
|
* @ORM\Column(name="is_active", type="boolean")
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
private $isActive;
|
private $isActive = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(name="created_at", type="datetime_immutable", nullable=true)
|
* @ORM\Column(name="created_at", type="datetime_immutable", nullable=true)
|
||||||
@ -243,6 +261,60 @@ class Team implements JsonSerializable
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isDailyLockEnabled(): bool
|
||||||
|
{
|
||||||
|
return $this->dailyLockEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool $dailyLockEnabled
|
||||||
|
* @return Team
|
||||||
|
*/
|
||||||
|
public function setDailyLockEnabled(bool $dailyLockEnabled): Team
|
||||||
|
{
|
||||||
|
$this->dailyLockEnabled = $dailyLockEnabled;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \DateTimeImmutable
|
||||||
|
*/
|
||||||
|
public function getDailyStartTime(): ?\DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->dailyStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \DateTimeInterface $dailyStartTime
|
||||||
|
* @return Team
|
||||||
|
*/
|
||||||
|
public function setDailyStartTime(?\DateTimeInterface $dailyStartTime): Team
|
||||||
|
{
|
||||||
|
$this->dailyStartTime = $dailyStartTime;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \DateTimeImmutable
|
||||||
|
*/
|
||||||
|
public function getDailyEndTime(): ?\DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->dailyEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \DateTimeInterface $dailyEndTime
|
||||||
|
* @return Team
|
||||||
|
*/
|
||||||
|
public function setDailyEndTime(?\DateTimeInterface $dailyEndTime): Team
|
||||||
|
{
|
||||||
|
$this->dailyEndTime = $dailyEndTime;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array|KanbanColumn
|
* @return array|KanbanColumn
|
||||||
*/
|
*/
|
||||||
@ -380,6 +452,13 @@ class Team implements JsonSerializable
|
|||||||
'members' => $this->getMembers() ?? [],
|
'members' => $this->getMembers() ?? [],
|
||||||
'labels' => $this->getLabels() ?? [],
|
'labels' => $this->getLabels() ?? [],
|
||||||
'filterId' => $this->getFilterId(),
|
'filterId' => $this->getFilterId(),
|
||||||
|
'dailyLockEnabled' => $this->isDailyLockEnabled(),
|
||||||
|
'dailyStartTime' => $this->getDailyStartTime()
|
||||||
|
? $this->getDailyStartTime()->format("H:i")
|
||||||
|
: null,
|
||||||
|
'dailyEndTime' => $this->getDailyEndTime()
|
||||||
|
? $this->getDailyEndTime()->format("H:i")
|
||||||
|
: null,
|
||||||
'backlogColumn' => $this->getBacklogColumn() ?? new KanbanColumn(),
|
'backlogColumn' => $this->getBacklogColumn() ?? new KanbanColumn(),
|
||||||
'inprogressColumn' => $this->getInprogressColumn() ?? new KanbanColumn(),
|
'inprogressColumn' => $this->getInprogressColumn() ?? new KanbanColumn(),
|
||||||
'verificationColumn' => $this->getVerificationColumn() ?? new KanbanColumn(),
|
'verificationColumn' => $this->getVerificationColumn() ?? new KanbanColumn(),
|
||||||
|
|||||||
@ -63,6 +63,42 @@ class Team
|
|||||||
*/
|
*/
|
||||||
private $filterId;
|
private $filterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Also a dummy field, a
|
||||||
|
* @Annotation\Type("Zend\Form\Element\Text")
|
||||||
|
* @Annotation\Options({
|
||||||
|
* "label": "Enabled"
|
||||||
|
* })
|
||||||
|
* @Annotation\Validator({
|
||||||
|
* "name":"NotEmpty",
|
||||||
|
* "options": {"type": Zend\Validator\NotEmpty::NULL}
|
||||||
|
* })
|
||||||
|
* @Annotation\Required(false)
|
||||||
|
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $dailyLockEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Annotation\Type("Zend\Form\Element\Text")
|
||||||
|
* @Annotation\Required(false)
|
||||||
|
* @Annotation\Options({
|
||||||
|
* "label": "Start time"
|
||||||
|
* })
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $dailyStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Annotation\Type("Zend\Form\Element\Text")
|
||||||
|
* @Annotation\Required(false)
|
||||||
|
* @Annotation\Options({
|
||||||
|
* "label": "End time"
|
||||||
|
* })
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $dailyEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a dummy field, not a text actually. Only used to filter the input
|
* This is a dummy field, not a text actually. Only used to filter the input
|
||||||
* @Annotation\Type("Zend\Form\Element\Text")
|
* @Annotation\Type("Zend\Form\Element\Text")
|
||||||
|
|||||||
21
src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php
Normal file → Executable file
21
src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php
Normal file → Executable file
@ -20,6 +20,7 @@
|
|||||||
namespace DoctrineExpressiveModule\Hydrator;
|
namespace DoctrineExpressiveModule\Hydrator;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use DateTimeImmutable;
|
||||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
use Doctrine\Common\Util\Inflector;
|
use Doctrine\Common\Util\Inflector;
|
||||||
@ -486,7 +487,8 @@ class DoctrineObject extends AbstractHydrator
|
|||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @param string $typeOfField
|
* @param string $typeOfField
|
||||||
* @return DateTime
|
* @return DateTime|DateTimeImmutable
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
protected function handleTypeConversions($value, $typeOfField)
|
protected function handleTypeConversions($value, $typeOfField)
|
||||||
{
|
{
|
||||||
@ -507,6 +509,23 @@ class DoctrineObject extends AbstractHydrator
|
|||||||
$value = new DateTime($value);
|
$value = new DateTime($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'datetimetz_immutable':
|
||||||
|
case 'datetime_immutable':
|
||||||
|
case 'time_immutable':
|
||||||
|
case 'date_immutable':
|
||||||
|
if ('' === $value) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_int($value)) {
|
||||||
|
$dateTime = new DateTimeImmutable();
|
||||||
|
$dateTime->setTimestamp($value);
|
||||||
|
$value = $dateTime;
|
||||||
|
} elseif (is_string($value)) {
|
||||||
|
$value = new DateTimeImmutable($value);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user