* 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;
|
||||
|
||||
/**
|
||||
* @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)
|
||||
* @var KanbanColumn
|
||||
@ -91,7 +109,7 @@ class Team implements JsonSerializable
|
||||
* @ORM\Column(name="is_active", type="boolean")
|
||||
* @var bool
|
||||
*/
|
||||
private $isActive;
|
||||
private $isActive = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="created_at", type="datetime_immutable", nullable=true)
|
||||
@ -243,6 +261,60 @@ class Team implements JsonSerializable
|
||||
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
|
||||
*/
|
||||
@ -380,6 +452,13 @@ class Team implements JsonSerializable
|
||||
'members' => $this->getMembers() ?? [],
|
||||
'labels' => $this->getLabels() ?? [],
|
||||
'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(),
|
||||
'inprogressColumn' => $this->getInprogressColumn() ?? new KanbanColumn(),
|
||||
'verificationColumn' => $this->getVerificationColumn() ?? new KanbanColumn(),
|
||||
|
||||
@ -63,6 +63,42 @@ class Team
|
||||
*/
|
||||
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
|
||||
* @Annotation\Type("Zend\Form\Element\Text")
|
||||
|
||||
23
src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php
Normal file → Executable file
23
src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php
Normal file → Executable file
@ -20,6 +20,7 @@
|
||||
namespace DoctrineExpressiveModule\Hydrator;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Doctrine\Common\Util\Inflector;
|
||||
@ -484,9 +485,10 @@ class DoctrineObject extends AbstractHydrator
|
||||
/**
|
||||
* Handle various type conversions that should be supported natively by Doctrine (like DateTime)
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
* @param string $typeOfField
|
||||
* @return DateTime
|
||||
* @return DateTime|DateTimeImmutable
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function handleTypeConversions($value, $typeOfField)
|
||||
{
|
||||
@ -507,6 +509,23 @@ class DoctrineObject extends AbstractHydrator
|
||||
$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;
|
||||
default:
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user