mirror of
https://gitlab.aliens-lyon.fr/encartes/backend.git
synced 2026-09-11 16:50:46 +02:00
Merge
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CorridorRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CorridorRepository::class)]
|
||||
class Corridor extends Place
|
||||
|
||||
@@ -16,7 +16,7 @@ class Cylinder
|
||||
#[ORM\Column(type: "float")]
|
||||
private $height;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: PlaneSurface::class, cascade: {"persist", "remove"})]
|
||||
#[ORM\OneToOne(targetEntity: PlaneSurface::class, cascade: ["persist", "remove"])]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private $cylinderbase;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PlaceRepository::class)]
|
||||
#[ORM\MappedSuperclass]
|
||||
#[ORM\InheritanceType("JOINED")]
|
||||
#[ORM\DiscriminatorColumn(name: "type", type: "string")]
|
||||
#[ORM\DiscriminatorMap(room: "Room", corridor: "Corridor")]
|
||||
|
||||
#[ORM\DiscriminatorMap(["room" => Room::class, "corridor" => Corridor::class])]
|
||||
class Place
|
||||
{
|
||||
#[ORM\Id]
|
||||
@@ -24,6 +24,9 @@ class Place
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Place::class, mappedBy: "connection")]
|
||||
private $connectedPlaces;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: PlaceName::class, mappedBy: "place")]
|
||||
private $names;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\PolyhedronRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PlaceNamenRepository::class)]
|
||||
class PlaceName
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: "string")]
|
||||
private $name;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Place::class, inversedBy: "names")]
|
||||
private $room;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->polyhedronface = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, PlaneSurface>
|
||||
*/
|
||||
public function getPolyhedronface(): Collection
|
||||
{
|
||||
return $this->polyhedronface;
|
||||
}
|
||||
|
||||
public function addPolyhedronface(PlaneSurface $polyhedronface): self
|
||||
{
|
||||
if (!$this->polyhedronface->contains($polyhedronface)) {
|
||||
$this->polyhedronface[] = $polyhedronface;
|
||||
$polyhedronface->setPolyhedron($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePolyhedronface(PlaneSurface $polyhedronface): self
|
||||
{
|
||||
if ($this->polyhedronface->removeElement($polyhedronface)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($polyhedronface->getPolyhedron() === $this) {
|
||||
$polyhedronface->setPolyhedron(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRoom(): ?Room
|
||||
{
|
||||
return $this->room;
|
||||
}
|
||||
|
||||
public function setRoom(?Room $room): self
|
||||
{
|
||||
$this->room = $room;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,7 +23,7 @@ class Room extends Place
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Cylinder::class, mappedBy: "room")]
|
||||
private $CylinderRepresentation;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -13,10 +13,10 @@ class ThreeDObjectFile
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[@ORM\Column(type: "string", length: 255)]
|
||||
#[ORM\Column(type: "string", length: 255)]
|
||||
private $filename;
|
||||
|
||||
#[@ORM\ManyToOne(targetEntity: Room::class, inversedBy: "ComplexRepresentation")]
|
||||
#[ORM\ManyToOne(targetEntity: Room::class, inversedBy: "ComplexRepresentation")]
|
||||
private $room;
|
||||
|
||||
public function getId(): ?int
|
||||
|
||||
Reference in New Issue
Block a user