location admin: add active field on Location and LocationType

This commit is contained in:
nobohan
2021-10-22 12:14:32 +02:00
parent 7dc4590580
commit 154416cddf
9 changed files with 105 additions and 2 deletions

View File

@@ -76,6 +76,12 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
*/
private bool $availableForUsers = false;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Groups({"read"})
*/
private bool $active = true;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @Serializer\Groups({"read"})
@@ -192,6 +198,18 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;

View File

@@ -40,6 +40,12 @@ class LocationType
*/
private bool $availableForUsers = true;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Groups({"read"})
*/
private bool $active = true;
/**
* @ORM\Column(type="string", length=32, options={"default"="optional"})
* @Serializer\Groups({"read"})
@@ -70,6 +76,18 @@ class LocationType
return $this;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getAvailableForUsers(): ?bool
{
return $this->availableForUsers;