improve homepage_widget tables with datas

This commit is contained in:
2022-01-31 18:59:33 +01:00
parent 971789d5cf
commit e4d5e40a8b
6 changed files with 95 additions and 22 deletions

View File

@@ -18,6 +18,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* SingleTask.
@@ -48,6 +49,7 @@ class SingleTask extends AbstractTask
*
* @ORM\Column(name="end_date", type="date", nullable=true)
* @Assert\Date
* @Serializer\Groups({"read"})
*/
private $endDate;
@@ -57,6 +59,7 @@ class SingleTask extends AbstractTask
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Serializer\Groups({"read"})
*/
private $id;
@@ -73,6 +76,7 @@ class SingleTask extends AbstractTask
* @var DateTime
*
* @ORM\Column(name="start_date", type="date", nullable=true)
* @Serializer\Groups({"read"})
* @Assert\Date
*
* @Assert\Expression(
@@ -102,6 +106,7 @@ class SingleTask extends AbstractTask
* and this.getEndDate() === null
*
* @ORM\Column(name="warning_interval", type="dateinterval", nullable=true)
* @Serializer\Groups({"read"})
*
* @Assert\Expression(
* "!(value != null and this.getEndDate() == null)",
@@ -162,6 +167,7 @@ class SingleTask extends AbstractTask
* Return null if warningDate or endDate is null
*
* @return DateTimeImmutable
* @Serializer\Groups({"read"})
*/
public function getWarningDate()
{