make somes changes on model: to manage isVisible field option + others

This commit is contained in:
2021-10-13 15:47:48 +02:00
parent 48f3c440a2
commit b418d13190
9 changed files with 102 additions and 30 deletions

View File

@@ -29,7 +29,7 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
* @ORM\JoinColumn(nullable=false)
* @Serializer\Groups({"read"})
*/
private ?LocationType $type = null;
private ?LocationType $locationType = null;
/**
* @ORM\OneToOne(targetEntity=Address::class, cascade={"persist", "remove"})
@@ -104,14 +104,14 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
return $this->id;
}
public function getType(): ?LocationType
public function getLocationType(): ?LocationType
{
return $this->type;
return $this->locationType;
}
public function setType(?LocationType $type): self
public function setLocationType(?LocationType $locationType): self
{
$this->type = $type;
$this->locationType = $locationType;
return $this;
}

View File

@@ -12,9 +12,9 @@ use Symfony\Component\Serializer\Annotation as Serializer;
*/
class LocationType
{
const STATUS_OPTIONAL = 'facultatif';
const STATUS_REQUIRED = 'obligatoire';
const STATUS_NEVER = 'jamais';
const STATUS_OPTIONAL = 'optional';
const STATUS_REQUIRED = 'required';
const STATUS_NEVER = 'never';
/**
* @ORM\Id
@@ -37,16 +37,16 @@ class LocationType
private bool $availableForUsers = true;
/**
* @ORM\Column(type="string", length=32)
* @ORM\Column(type="string", length=32, options={"default"="optional"})
* @Serializer\Groups({"read"})
*/
private ?string $addressRequired = null;
private string $addressRequired = self::STATUS_OPTIONAL;
/**
* @ORM\Column(type="string", length=32)
* @ORM\Column(type="string", length=32, options={"default"="optional"})
* @Serializer\Groups({"read"})
*/
private ?string $contactData = null;
private string $contactData = self::STATUS_OPTIONAL;
public function getId(): ?int