diff --git a/migrations/Version20240605094344.php b/migrations/Version20240605094344.php new file mode 100644 index 0000000..5f6de70 --- /dev/null +++ b/migrations/Version20240605094344.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE organizational_unit ADD type VARCHAR(255) NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE organizational_unit DROP type'); + } +} diff --git a/migrations/Version20240605100013.php b/migrations/Version20240605100013.php new file mode 100644 index 0000000..4d24099 --- /dev/null +++ b/migrations/Version20240605100013.php @@ -0,0 +1,33 @@ +addSql('ALTER TABLE organizational_unit ADD network_settings VARCHAR(255) DEFAULT NULL, ADD location VARCHAR(255) DEFAULT NULL, ADD projector TINYINT(1) DEFAULT NULL, ADD board TINYINT(1) DEFAULT NULL, CHANGE network_settings_id capacity INT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE organizational_unit DROP network_settings, DROP location, DROP projector, DROP board, CHANGE capacity network_settings_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE organizational_unit ADD CONSTRAINT FK_749AEB2D9B9A36D0 FOREIGN KEY (network_settings_id) REFERENCES network_settings (id)'); + $this->addSql('CREATE INDEX IDX_749AEB2D9B9A36D0 ON organizational_unit (network_settings_id)'); + } +} diff --git a/src/Entity/OrganizationalUnit.php b/src/Entity/OrganizationalUnit.php index 6e58c7f..2bb01b8 100644 --- a/src/Entity/OrganizationalUnit.php +++ b/src/Entity/OrganizationalUnit.php @@ -45,6 +45,7 @@ class OrganizationalUnit extends AbstractEntity private Collection $organizationalUnits; #[ORM\ManyToOne(inversedBy: 'organizationalUnits')] + #[ORM\Column(nullable: true)] private ?NetworkSettings $networkSettings = null; /** @@ -59,6 +60,21 @@ class OrganizationalUnit extends AbstractEntity #[ORM\OneToMany(mappedBy: 'organizationalUnit', targetEntity: Client::class)] private Collection $clients; + #[ORM\Column(length: 255)] + private ?string $type = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $location = null; + + #[ORM\Column(nullable: true)] + private ?bool $projector = null; + + #[ORM\Column(nullable: true)] + private ?bool $board = null; + + #[ORM\Column(nullable: true)] + private ?int $capacity = null; + public function __construct() { parent::__construct(); @@ -236,4 +252,64 @@ class OrganizationalUnit extends AbstractEntity return $this; } + + public function getType(): ?string + { + return $this->type; + } + + public function setType(string $type): static + { + $this->type = $type; + + return $this; + } + + public function getLocation(): ?string + { + return $this->location; + } + + public function setLocation(?string $location): static + { + $this->location = $location; + + return $this; + } + + public function isProjector(): ?bool + { + return $this->projector; + } + + public function setProjector(?bool $projector): static + { + $this->projector = $projector; + + return $this; + } + + public function isBoard(): ?bool + { + return $this->board; + } + + public function setBoard(?bool $board): static + { + $this->board = $board; + + return $this; + } + + public function getCapacity(): ?int + { + return $this->capacity; + } + + public function setCapacity(?int $capacity): static + { + $this->capacity = $capacity; + + return $this; + } } diff --git a/src/Model/OrganizationalUnitTypes.php b/src/Model/OrganizationalUnitTypes.php new file mode 100644 index 0000000..28b39e8 --- /dev/null +++ b/src/Model/OrganizationalUnitTypes.php @@ -0,0 +1,8 @@ +