| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729 |
- <?php
- namespace AppBundle\Entity\Place;
- use AppBundle\Annotation\DefaultField;
- use AppBundle\Entity\Booking\Course;
- use AppBundle\Entity\Booking\EducationalProject;
- use AppBundle\Entity\Booking\Examen;
- use AppBundle\Entity\Core\ContactPoint;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Entity\Product\Equipment;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Lieu physique, bâtiment
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Place\Repository\PlaceRepository')]
- class Place extends AbstractPlace
- {
- /**
- * @var string A short description of the item.
- */
- #[Assert\Type(type: 'string')]
- #[ORM\Column(type: 'text', nullable: true)]
- #[Groups(['place', 'place_list'])]
- private $description;
- /**
- * @var ArrayCollection<OpeningHoursSpecification> The opening hours of a certain place.
- */
- #[Assert\Valid]
- #[ORM\ManyToMany(targetEntity: 'OpeningHoursSpecification', cascade: ['persist'], orphanRemoval: true)]
- #[ORM\JoinTable(joinColumns: [], inverseJoinColumns: [])]
- #[ORM\JoinColumn(name: 'place_id', referencedColumnName: 'id')]
- #[ORM\JoinColumn(name: 'openinghoursspecification_id', referencedColumnName: 'id', unique: true)]
- #[Groups(['place_openinghoursspecification'])]
- private $openingHoursSpecification;
- /**
- * @var Organization
- *
- * @DefaultField()
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'places')]
- #[Groups(['place'])]
- private $organization;
- /**
- * @var ArrayCollection<ContactPoint>
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\ContactPoint', cascade: ['persist'], inversedBy: 'place')]
- #[Assert\Valid]
- #[Groups(['place_contactpoint', 'place_list'])]
- private $contactpoint;
- /**
- * @var bool
- */
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Groups(['place', 'place_list'])]
- private $internal = false;
- /**
- * @var string
- */
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['AppBundle\Enum\Place\SiteStatusEnum', 'toArray'])]
- #[ORM\Column(type: 'string', nullable: true)]
- #[Groups(['place', 'place_list'])]
- private $status;
- /**
- * @var string
- */
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['AppBundle\Enum\Place\SiteTypeEnum', 'toArray'])]
- #[ORM\Column(type: 'string', nullable: true)]
- #[Groups(['place', 'place_list'])]
- private $type;
- /**
- * @var bool
- */
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Groups(['place', 'place_list'])]
- private $sharing = false;
- /**
- * @var bool
- */
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Groups(['place', 'place_list'])]
- private $practice = false;
- /**
- * @var int
- */
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Groups(['place', 'place_list', 'place_reference'])]
- private $floorSize;
- /**
- * @var int
- */
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Groups(['place', 'place_list', 'place_reference'])]
- private $capacity;
- /**
- * var ArrayCollection<Room>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Place\Room', cascade: ['persist'], mappedBy: 'place', orphanRemoval: true)]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['place_room', 'place_list'])]
- private $rooms;
- /**
- * var ArrayCollection<Control>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Place\PlaceControl', cascade: ['persist'], mappedBy: 'place', orphanRemoval: true)]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['place_control'])]
- private $controls;
- /**
- * var ArrayCollection<Repair>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Place\PlaceRepair', cascade: ['persist'], mappedBy: 'place', orphanRemoval: true)]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['place_repair'])]
- private $repairs;
- /**
- * @var ArrayCollection<Course>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\Course', mappedBy: 'place')]
- #[Groups(['place_booking'])]
- private $courses;
- /**
- * @var ArrayCollection<EducationalProject>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', mappedBy: 'place')]
- #[Groups(['place_booking'])]
- private $educationalProjects;
- /**
- * @var ArrayCollection<Examen>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\Examen', mappedBy: 'place')]
- #[Groups(['place_booking'])]
- private $examens;
- /**
- * @var ArrayCollection<Equipment>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'placeStorage')]
- #[Groups(['place_equipment'])]
- private $equipmentStorages;
- /**
- * @var ArrayCollection<Equipment>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'placeWhereIsUsed')]
- #[Groups(['place_equipment', 'place_list'])]
- private $equipmentUseds;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 14, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['place'])]
- private $siretNumber;
- public function __construct()
- {
- $this->openingHoursSpecification = new ArrayCollection();
- $this->contactpoint = new ArrayCollection();
- $this->rooms = new ArrayCollection();
- $this->controls = new ArrayCollection();
- $this->repairs = new ArrayCollection();
- $this->courses = new ArrayCollection();
- $this->educationalProjects = new ArrayCollection();
- $this->examens = new ArrayCollection();
- $this->equipmentStorages = new ArrayCollection();
- $this->equipmentUseds = new ArrayCollection();
- }
- /**
- * Sets description.
- *
- * @param string $description
- *
- * @return $this
- */
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- /**
- * Gets description.
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->description;
- }
- /**
- * Adds openingHoursSpecification.
- *
- * @param OpeningHoursSpecification $openingHoursSpecification
- *
- * @return $this
- */
- public function addOpeningHoursSpecification(OpeningHoursSpecification $openingHoursSpecification)
- {
- $this->openingHoursSpecification[] = $openingHoursSpecification;
- return $this;
- }
- /**
- * Removes openingHoursSpecification.
- *
- * @param OpeningHoursSpecification $openingHoursSpecification
- *
- * @return $this
- */
- public function removeOpeningHoursSpecification(OpeningHoursSpecification $openingHoursSpecification)
- {
- $this->openingHoursSpecification->removeElement($openingHoursSpecification);
- return $this;
- }
- /**
- * Gets openingHoursSpecification.
- *
- * @return ArrayCollection<OpeningHoursSpecification>
- */
- public function getOpeningHoursSpecification()
- {
- return $this->openingHoursSpecification;
- }
- /**
- * Sets organization.
- *
- * @param Organization $organization
- *
- * @return $this
- */
- public function setOrganization(Organization $organization = null)
- {
- $this->organization = $organization;
- return $this;
- }
- /**
- * Gets organization.
- *
- * @return Organization
- */
- public function getOrganization()
- {
- return $this->organization;
- }
- /**
- * Adds contactpoint.
- *
- * @param ContactPoint $contactpoint
- *
- * @return $this
- */
- public function addContactpoint(ContactPoint $contactpoint)
- {
- $this->contactpoint[] = $contactpoint;
- return $this;
- }
- /**
- * Removes contactpoint.
- *
- * @param ContactPoint $contactpoint
- *
- * @return $this
- */
- public function removeContactpoint(ContactPoint $contactpoint)
- {
- $this->contactpoint->removeElement($contactpoint);
- return $this;
- }
- /**
- * Gets contactpoint.
- *
- * @return ArrayCollection<ContactPoint>
- */
- public function getContactpoint()
- {
- return $this->contactpoint;
- }
- /**
- * Sets internal.
- *
- * @param bool $internal
- *
- * @return $this
- */
- public function setInternal($internal)
- {
- $this->internal = $internal;
- return $this;
- }
- /**
- * Gets internal.
- *
- * @return bool
- */
- public function getInternal()
- {
- return $this->internal;
- }
- /**
- * Sets status.
- *
- * @param string $status
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->status = $status;
- return $this;
- }
- /**
- * Gets status.
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->status;
- }
- /**
- * Sets type.
- *
- * @param string $type
- *
- * @return $this
- */
- public function setType($type)
- {
- $this->type = $type;
- return $this;
- }
- /**
- * Gets type.
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Sets sharing.
- *
- * @param bool $sharing
- *
- * @return $this
- */
- public function setSharing($sharing)
- {
- $this->sharing = $sharing;
- return $this;
- }
- /**
- * Gets sharing.
- *
- * @return bool
- */
- public function getSharing()
- {
- return $this->sharing;
- }
- /**
- * Sets practice.
- *
- * @param bool $practice
- *
- * @return $this
- */
- public function setPractice($practice)
- {
- $this->practice = $practice;
- return $this;
- }
- /**
- * Gets practice.
- *
- * @return bool
- */
- public function getPractice()
- {
- return $this->practice;
- }
- /**
- * Sets floorSize.
- *
- * @param int $floorSize
- *
- * @return $this
- */
- public function setFloorSize($floorSize)
- {
- $this->floorSize = $floorSize;
- return $this;
- }
- /**
- * Gets floorSize.
- *
- * @return int
- */
- public function getFloorSize()
- {
- return $this->floorSize;
- }
- /**
- * Sets capacity.
- *
- * @param int $capacity
- *
- * @return $this
- */
- public function setCapacity($capacity)
- {
- $this->capacity = $capacity;
- return $this;
- }
- /**
- * Gets capacity.
- *
- * @return int
- */
- public function getCapacity()
- {
- return $this->capacity;
- }
- /**
- * Adds control.
- *
- * @param PlaceControl $control
- *
- * @return $this
- */
- public function addControl(PlaceControl $control)
- {
- $control->setPlace($this);
- $this->controls[] = $control;
- return $this;
- }
- /**
- * Removes control.
- *
- * @param PlaceControl $control
- *
- * @return $this
- */
- public function removeControl(PlaceControl $control)
- {
- $this->controls->removeElement($control);
- return $this;
- }
- /**
- * Gets control.
- *
- * @return ArrayCollection<PlaceControl>
- */
- public function getControls()
- {
- return $this->controls;
- }
- /**
- * Adds repair.
- *
- * @param PlaceRepair $repair
- *
- * @return $this
- */
- public function addRepair(PlaceRepair $repair)
- {
- $repair->setPlace($this);
- $this->repairs[] = $repair;
- return $this;
- }
- /**
- * Removes repair.
- *
- * @param PlaceRepair $repair
- *
- * @return $this
- */
- public function removeRepair(PlaceRepair $repair)
- {
- $this->repairs->removeElement($repair);
- return $this;
- }
- /**
- * Gets repairs.
- *
- * @return ArrayCollection<PlaceRepair>
- */
- public function getRepairs()
- {
- return $this->repairs;
- }
- /**
- * Add course
- *
- * @param \AppBundle\Entity\Booking\Course $course
- *
- * @return Place
- */
- public function addCourse(\AppBundle\Entity\Booking\Course $course)
- {
- $this->courses[] = $course;
- return $this;
- }
- /**
- * Remove course
- *
- * @param \AppBundle\Entity\Booking\Course $course
- */
- public function removeCourse(\AppBundle\Entity\Booking\Course $course)
- {
- $this->courses->removeElement($course);
- }
- /**
- * Get courses
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getCourses()
- {
- return $this->courses;
- }
- /**
- * Add educationalProject
- *
- * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
- *
- * @return Place
- */
- public function addEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
- {
- $this->educationalProjects[] = $educationalProject;
- return $this;
- }
- /**
- * Remove educationalProject
- *
- * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
- */
- public function removeEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
- {
- $this->educationalProjects->removeElement($educationalProject);
- }
- /**
- * Get educationalProjects
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationalProjects()
- {
- return $this->educationalProjects;
- }
- /**
- * Add examen
- *
- * @param \AppBundle\Entity\Booking\Examen $examen
- *
- * @return Place
- */
- public function addExamen(\AppBundle\Entity\Booking\Examen $examen)
- {
- $this->examens[] = $examen;
- return $this;
- }
- /**
- * Remove examen
- *
- * @param \AppBundle\Entity\Booking\Examen $examen
- */
- public function removeExamen(\AppBundle\Entity\Booking\Examen $examen)
- {
- $this->examens->removeElement($examen);
- }
- /**
- * Get examens
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getExamens()
- {
- return $this->examens;
- }
- /**
- * Add equipmentStorage
- *
- * @param \AppBundle\Entity\Product\Equipment $equipmentStorage
- *
- * @return Place
- */
- public function addEquipmentStorage(\AppBundle\Entity\Product\Equipment $equipmentStorage)
- {
- $this->equipmentStorages[] = $equipmentStorage;
- return $this;
- }
- /**
- * Remove equipmentStorage
- *
- * @param \AppBundle\Entity\Product\Equipment $equipmentStorage
- */
- public function removeEquipmentStorage(\AppBundle\Entity\Product\Equipment $equipmentStorage)
- {
- $this->equipmentStorages->removeElement($equipmentStorage);
- }
- /**
- * Get equipmentStorages
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEquipmentStorages()
- {
- return $this->equipmentStorages;
- }
- /**
- * Add equipmentUsed
- *
- * @param \AppBundle\Entity\Product\Equipment $equipmentUsed
- *
- * @return Place
- */
- public function addEquipmentUsed(\AppBundle\Entity\Product\Equipment $equipmentUsed)
- {
- $equipmentUsed->setPlaceWhereIsUsed($this);
- $this->equipmentUseds[] = $equipmentUsed;
- return $this;
- }
- /**
- * Remove equipmentUsed
- *
- * @param \AppBundle\Entity\Product\Equipment $equipmentUsed
- */
- public function removeEquipmentUsed(\AppBundle\Entity\Product\Equipment $equipmentUsed)
- {
- $equipmentUsed->setPlaceWhereIsUsed(null);
- $this->equipmentUseds->removeElement($equipmentUsed);
- }
- /**
- * Get equipmentUseds
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEquipmentUseds()
- {
- return $this->equipmentUseds;
- }
- /**
- * Sets siretNumber.
- *
- * @param string $siretNumber
- *
- * @return $this
- */
- public function setSiretNumber($siretNumber)
- {
- $this->siretNumber = $siretNumber;
- return $this;
- }
- /**
- * Gets siretNumber.
- *
- * @return string
- */
- public function getSiretNumber()
- {
- return $this->siretNumber;
- }
- /**
- * Add room
- *
- * @param \AppBundle\Entity\Place\Room $room
- *
- * @return Place
- */
- public function addRoom(\AppBundle\Entity\Place\Room $room)
- {
- $room->setPlace($this);
- $this->rooms[] = $room;
- return $this;
- }
- /**
- * Remove room
- *
- * @param \AppBundle\Entity\Place\Room $room
- */
- public function removeRoom(\AppBundle\Entity\Place\Room $room)
- {
- $this->rooms->removeElement($room);
- }
- /**
- * Get rooms
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getRooms()
- {
- return $this->rooms;
- }
- }
|