|
@@ -7,6 +7,10 @@ use App\Attribute\ActivityYearConstraintAware;
|
|
|
use App\Attribute\OrganizationDefaultValue;
|
|
use App\Attribute\OrganizationDefaultValue;
|
|
|
use App\Entity\Traits\ActivityYearTrait;
|
|
use App\Entity\Traits\ActivityYearTrait;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
+use App\Enum\Booking\VisibilityEnum;
|
|
|
|
|
+use Ramsey\Uuid\Doctrine\UuidGenerator;
|
|
|
|
|
+use Ramsey\Uuid\UuidInterface;
|
|
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Classe ... qui ...
|
|
* Classe ... qui ...
|
|
@@ -23,17 +27,42 @@ abstract class AbstractBooking
|
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\GeneratedValue]
|
|
|
protected ?int $id = null;
|
|
protected ?int $id = null;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ protected string $name;
|
|
|
|
|
+
|
|
|
#[ORM\Column(type: 'datetime', nullable: true)]
|
|
#[ORM\Column(type: 'datetime', nullable: true)]
|
|
|
protected ?\DateTimeInterface $datetimeStart = null;
|
|
protected ?\DateTimeInterface $datetimeStart = null;
|
|
|
|
|
|
|
|
#[ORM\Column(type: 'datetime', nullable: true)]
|
|
#[ORM\Column(type: 'datetime', nullable: true)]
|
|
|
protected ?\DateTimeInterface $datetimeEnd = null;
|
|
protected ?\DateTimeInterface $datetimeEnd = null;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(nullable: false)]
|
|
|
|
|
+ #[Assert\Choice(callback: [VisibilityEnum::class, 'toArray'])]
|
|
|
|
|
+ protected string $visibility;
|
|
|
|
|
+
|
|
|
|
|
+ #[ORM\Column(unique: true)]
|
|
|
|
|
+ protected string $uuid;
|
|
|
|
|
+
|
|
|
public function getId(): ?int
|
|
public function getId(): ?int
|
|
|
{
|
|
{
|
|
|
return $this->id;
|
|
return $this->id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getName(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->name;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string $name
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setName(string $name): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->name = $name;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public function setDatetimeStart(\DateTimeInterface $datetimeStart = null) : self
|
|
public function setDatetimeStart(\DateTimeInterface $datetimeStart = null) : self
|
|
|
{
|
|
{
|
|
@@ -58,4 +87,36 @@ abstract class AbstractBooking
|
|
|
{
|
|
{
|
|
|
return $this->datetimeEnd;
|
|
return $this->datetimeEnd;
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getVisibility(): ?string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->visibility;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string|null $visibility
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setVisibility(?string $visibility): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->visibility = $visibility;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getUuid(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->uuid;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string $uuid
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setUuid(string $uuid): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->uuid = $uuid;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|