mirror of
https://gitlab.aliens-lyon.fr/encartes/backend.git
synced 2026-09-11 16:50:46 +02:00
Mise à jour de symfony
Mise à jour de PHP Correction des entitées from attributes to annotations Ajout des entitées des objets 3D
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use App\Repository\SiteRepository;
|
||||
|
||||
class MapApiController extends AbstractController
|
||||
{
|
||||
#[Route('/map/api')]
|
||||
public function index(SiteRepository $srep): JsonResponse
|
||||
{
|
||||
|
||||
return $this->json([
|
||||
'message' => 'Welcome to your new controller!',
|
||||
'path' => 'src/Controller/MapApiController.php',
|
||||
'sites' => $srep->allSites()[0]->getZeroLatitude()
|
||||
]);
|
||||
}
|
||||
}
|
||||
+7
-15
@@ -7,27 +7,19 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=BuildingRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: BuildingRepository::class)]
|
||||
class Building
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Site::class, inversedBy="buildings")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Site::class, inversedBy: "buildings")]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private $site;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Floor::class, mappedBy="building")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Floor::class, mappedBy: "building")]
|
||||
private $floors;
|
||||
|
||||
public function __construct()
|
||||
|
||||
+6
-13
@@ -3,24 +3,17 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CorridorRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=CorridorRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: CorridorRepository::class)]
|
||||
class Corridor extends Place
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Floor::class, inversedBy="corridors")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Floor::class, inversedBy: "corridors")]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private $floor;
|
||||
|
||||
public function getId(): ?int
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CylinderRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CylinderRepository::class)]
|
||||
class Cylinder
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: "float")]
|
||||
private $height;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: PlaneSurface::class, cascade: {"persist", "remove"})]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private $cylinderbase;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Room::class, inversedBy: "CylinderRepresentation")]
|
||||
private $room;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getHeight(): ?float
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
public function setHeight(float $height): self
|
||||
{
|
||||
$this->height = $height;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCylinderbase(): ?PlaneSurface
|
||||
{
|
||||
return $this->cylinderbase;
|
||||
}
|
||||
|
||||
public function setCylinderbase(PlaneSurface $cylinderbase): self
|
||||
{
|
||||
$this->cylinderbase = $cylinderbase;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRoom(): ?Room
|
||||
{
|
||||
return $this->room;
|
||||
}
|
||||
|
||||
public function setRoom(?Room $room): self
|
||||
{
|
||||
$this->room = $room;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
+7
-15
@@ -7,27 +7,19 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=FloorRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: FloorRepository::class)]
|
||||
class Floor
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Building::class, inversedBy="floors")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Building::class, inversedBy: "floors")]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private $building;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Corridor::class, mappedBy="floor")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Corridor::class, mappedBy: "floor")]
|
||||
private $corridors;
|
||||
|
||||
public function __construct()
|
||||
|
||||
+9
-17
@@ -7,29 +7,21 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=PlaceRepository::class)
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="type", type="string")
|
||||
* @ORM\DiscriminatorMap({"room"="Room","corridor"="Corridor"})
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: PlaceRepository::class)]
|
||||
#[ORM\InheritanceType("JOINED")]
|
||||
#[ORM\DiscriminatorColumn(name: "type", type: "string")]
|
||||
#[ORM\DiscriminatorMap({"room": "Room","corridor": "Corridor"})]
|
||||
class Place
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Place::class, inversedBy="connectedPlaces")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Place::class, inversedBy: "connectedPlaces")]
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Place::class, mappedBy="connection")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Place::class, mappedBy: "connection")]
|
||||
private $connectedPlaces;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\PlaneSurfaceRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PlaneSurfaceRepository::class)]
|
||||
class PlaneSurface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Point::class)]
|
||||
private $polygonpoint;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Polyhedron::class, inversedBy: "polyhedronface")]
|
||||
private $polyhedron;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: PolySurface::class, inversedBy: "polysurfaceComponent")]
|
||||
private $polySurface;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->polygonpoint = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Point>
|
||||
*/
|
||||
public function getPolygonpoint(): Collection
|
||||
{
|
||||
return $this->polygonpoint;
|
||||
}
|
||||
|
||||
public function addPolygonpoint(Point $polygonpoint): self
|
||||
{
|
||||
if (!$this->polygonpoint->contains($polygonpoint)) {
|
||||
$this->polygonpoint[] = $polygonpoint;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePolygonpoint(Point $polygonpoint): self
|
||||
{
|
||||
$this->polygonpoint->removeElement($polygonpoint);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPolyhedron(): ?Polyhedron
|
||||
{
|
||||
return $this->polyhedron;
|
||||
}
|
||||
|
||||
public function setPolyhedron(?Polyhedron $polyhedron): self
|
||||
{
|
||||
$this->polyhedron = $polyhedron;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPolySurface(): ?PolySurface
|
||||
{
|
||||
return $this->polySurface;
|
||||
}
|
||||
|
||||
public function setPolySurface(?PolySurface $polySurface): self
|
||||
{
|
||||
$this->polySurface = $polySurface;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\PointRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PointRepository::class)]
|
||||
class Point
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: "float")]
|
||||
private $x;
|
||||
|
||||
#[ORM\Column(type: "float")]
|
||||
private $y;
|
||||
|
||||
#[ORM\Column(type: "float")]
|
||||
private $z;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getX(): ?float
|
||||
{
|
||||
return $this->x;
|
||||
}
|
||||
|
||||
public function setX(float $x): self
|
||||
{
|
||||
$this->x = $x;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getY(): ?float
|
||||
{
|
||||
return $this->y;
|
||||
}
|
||||
|
||||
public function setY(float $y): self
|
||||
{
|
||||
$this->y = $y;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getZ(): ?float
|
||||
{
|
||||
return $this->z;
|
||||
}
|
||||
|
||||
public function setZ(float $z): self
|
||||
{
|
||||
$this->z = $z;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\PolySurfaceRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PolySurfaceRepository::class)]
|
||||
class PolySurface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: PlaneSurface::class, mappedBy: "polySurface")]
|
||||
private $polysurfaceComponent;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Corridor::class)]
|
||||
private $SurfaceRepresentation;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->polysurfaceComponent = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, PlaneSurface>
|
||||
*/
|
||||
public function getPolysurfaceComponent(): Collection
|
||||
{
|
||||
return $this->polysurfaceComponent;
|
||||
}
|
||||
|
||||
public function addPolysurfaceComponent(PlaneSurface $polysurfaceComponent): self
|
||||
{
|
||||
if (!$this->polysurfaceComponent->contains($polysurfaceComponent)) {
|
||||
$this->polysurfaceComponent[] = $polysurfaceComponent;
|
||||
$polysurfaceComponent->setPolySurface($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePolysurfaceComponent(PlaneSurface $polysurfaceComponent): self
|
||||
{
|
||||
if ($this->polysurfaceComponent->removeElement($polysurfaceComponent)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($polysurfaceComponent->getPolySurface() === $this) {
|
||||
$polysurfaceComponent->setPolySurface(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSurfaceRepresentation(): ?Corridor
|
||||
{
|
||||
return $this->SurfaceRepresentation;
|
||||
}
|
||||
|
||||
public function setSurfaceRepresentation(?Corridor $SurfaceRepresentation): self
|
||||
{
|
||||
$this->SurfaceRepresentation = $SurfaceRepresentation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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: PolyhedronRepository::class)]
|
||||
class Polyhedron
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: PlaneSurface::class, mappedBy: "polyhedron")]
|
||||
private $polyhedronface;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Room::class, inversedBy: "PolyhedronRepresentation")]
|
||||
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;
|
||||
}
|
||||
}
|
||||
+113
-8
@@ -3,22 +3,127 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\RoomRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=RoomRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: RoomRepository::class)]
|
||||
class Room extends Place
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: ThreeDObjectFile::class, mappedBy: "room")]
|
||||
private $ComplexRepresentation;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Polyhedron::class, mappedBy: "room")]
|
||||
private $PolyhedronRepresentation;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Cylinder::class, mappedBy: "room")]
|
||||
private $CylinderRepresentation;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->ComplexRepresentation = new ArrayCollection();
|
||||
$this->PolyhedronRepresentation = new ArrayCollection();
|
||||
$this->CylinderRepresentation = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, ThreeDObjectFile>
|
||||
*/
|
||||
public function getComplexRepresentation(): Collection
|
||||
{
|
||||
return $this->ComplexRepresentation;
|
||||
}
|
||||
|
||||
public function addComplexRepresentation(ThreeDObjectFile $complexRepresentation): self
|
||||
{
|
||||
if (!$this->ComplexRepresentation->contains($complexRepresentation)) {
|
||||
$this->ComplexRepresentation[] = $complexRepresentation;
|
||||
$complexRepresentation->setRoom($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeComplexRepresentation(ThreeDObjectFile $complexRepresentation): self
|
||||
{
|
||||
if ($this->ComplexRepresentation->removeElement($complexRepresentation)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($complexRepresentation->getRoom() === $this) {
|
||||
$complexRepresentation->setRoom(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Polyhedron>
|
||||
*/
|
||||
public function getPolyhedronRepresentation(): Collection
|
||||
{
|
||||
return $this->PolyhedronRepresentation;
|
||||
}
|
||||
|
||||
public function addPolyhedronRepresentation(Polyhedron $polyhedronRepresentation): self
|
||||
{
|
||||
if (!$this->PolyhedronRepresentation->contains($polyhedronRepresentation)) {
|
||||
$this->PolyhedronRepresentation[] = $polyhedronRepresentation;
|
||||
$polyhedronRepresentation->setRoom($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePolyhedronRepresentation(Polyhedron $polyhedronRepresentation): self
|
||||
{
|
||||
if ($this->PolyhedronRepresentation->removeElement($polyhedronRepresentation)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($polyhedronRepresentation->getRoom() === $this) {
|
||||
$polyhedronRepresentation->setRoom(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Cylinder>
|
||||
*/
|
||||
public function getCylinderRepresentation(): Collection
|
||||
{
|
||||
return $this->CylinderRepresentation;
|
||||
}
|
||||
|
||||
public function addCylinderRepresentation(Cylinder $cylinderRepresentation): self
|
||||
{
|
||||
if (!$this->CylinderRepresentation->contains($cylinderRepresentation)) {
|
||||
$this->CylinderRepresentation[] = $cylinderRepresentation;
|
||||
$cylinderRepresentation->setRoom($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeCylinderRepresentation(Cylinder $cylinderRepresentation): self
|
||||
{
|
||||
if ($this->CylinderRepresentation->removeElement($cylinderRepresentation)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($cylinderRepresentation->getRoom() === $this) {
|
||||
$cylinderRepresentation->setRoom(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-17
@@ -7,31 +7,21 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=SiteRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: SiteRepository::class)]
|
||||
class Site
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float")
|
||||
*/
|
||||
#[ORM\Column(type: "float")]
|
||||
private $zeroLatitude;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float")
|
||||
*/
|
||||
#[ORM\Column(type: "float")]
|
||||
private $zeroLongitude;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Building::class, mappedBy="site")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Building::class, mappedBy: "site")]
|
||||
private $buildings;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ThreeDObjectFileRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ThreeDObjectFileRepository::class)]
|
||||
class ThreeDObjectFile
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: "integer")]
|
||||
private $id;
|
||||
|
||||
#[@ORM\Column(type: "string", length: 255)]
|
||||
private $filename;
|
||||
|
||||
#[@ORM\ManyToOne(targetEntity: Room::class, inversedBy: "ComplexRepresentation")]
|
||||
private $room;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getFilename(): ?string
|
||||
{
|
||||
return $this->filename;
|
||||
}
|
||||
|
||||
public function setFilename(string $filename): self
|
||||
{
|
||||
$this->filename = $filename;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRoom(): ?Room
|
||||
{
|
||||
return $this->room;
|
||||
}
|
||||
|
||||
public function setRoom(?Room $room): self
|
||||
{
|
||||
$this->room = $room;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Cylinder;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Cylinder>
|
||||
*
|
||||
* @method Cylinder|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Cylinder|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Cylinder[] findAll()
|
||||
* @method Cylinder[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class CylinderRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Cylinder::class);
|
||||
}
|
||||
|
||||
public function add(Cylinder $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(Cylinder $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Cylinder[] Returns an array of Cylinder objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('c.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Cylinder
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PlaneSurface;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PlaneSurface>
|
||||
*
|
||||
* @method PlaneSurface|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PlaneSurface|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PlaneSurface[] findAll()
|
||||
* @method PlaneSurface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PlaneSurfaceRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PlaneSurface::class);
|
||||
}
|
||||
|
||||
public function add(PlaneSurface $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(PlaneSurface $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return PlaneSurface[] Returns an array of PlaneSurface objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?PlaneSurface
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Point;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Point>
|
||||
*
|
||||
* @method Point|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Point|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Point[] findAll()
|
||||
* @method Point[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PointRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Point::class);
|
||||
}
|
||||
|
||||
public function add(Point $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(Point $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Point[] Returns an array of Point objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Point
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PolySurface;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PolySurface>
|
||||
*
|
||||
* @method PolySurface|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PolySurface|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PolySurface[] findAll()
|
||||
* @method PolySurface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PolySurfaceRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PolySurface::class);
|
||||
}
|
||||
|
||||
public function add(PolySurface $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(PolySurface $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return PolySurface[] Returns an array of PolySurface objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?PolySurface
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Polyhedron;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Polyhedron>
|
||||
*
|
||||
* @method Polyhedron|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Polyhedron|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Polyhedron[] findAll()
|
||||
* @method Polyhedron[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PolyhedronRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Polyhedron::class);
|
||||
}
|
||||
|
||||
public function add(Polyhedron $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(Polyhedron $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Polyhedron[] Returns an array of Polyhedron objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Polyhedron
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
@@ -38,6 +38,11 @@ class SiteRepository extends ServiceEntityRepository
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function allSites(): array
|
||||
{
|
||||
return $this->createQueryBuilder('s')->orderBy('s.id','ASC')->getQuery()->getResult();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Site[] Returns an array of Site objects
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\ThreeDObjectFile;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<ThreeDObjectFile>
|
||||
*
|
||||
* @method ThreeDObjectFile|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method ThreeDObjectFile|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method ThreeDObjectFile[] findAll()
|
||||
* @method ThreeDObjectFile[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class ThreeDObjectFileRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, ThreeDObjectFile::class);
|
||||
}
|
||||
|
||||
public function add(ThreeDObjectFile $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(ThreeDObjectFile $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return ThreeDObjectFile[] Returns an array of ThreeDObjectFile objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('t')
|
||||
// ->andWhere('t.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('t.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?ThreeDObjectFile
|
||||
// {
|
||||
// return $this->createQueryBuilder('t')
|
||||
// ->andWhere('t.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user