| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <?php
- namespace AppBundle\Entity\Organization;
- use AppBundle\Annotation\DefaultField;
- use AppBundle\Entity\Core\Tagg;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * Jury composé d'Access pour unr Organization
- *
- * @Iri("http://schema.org/Jury")
- */
- #[ORM\Entity]
- class Jury
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['jury', 'jury_access', 'examenconvocation_list_examen', 'examen_details', 'planning_detail', 'presence_attendance'])]
- private $id;
- /**
- * @var Organization
- *
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'Organization', inversedBy: 'juries')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['jury'])]
- private $organization;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 35)]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Groups(['jury', 'jury_reference', 'examenconvocation_list_examen', 'examen_details_jury'])]
- private $name;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['jury'])]
- private $date;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['jury'])]
- private $endDate;
- /**
- * @var Access
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'juryMembers', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'juries_members')]
- #[Groups(['jury_access', 'examen_details_jury', 'presence_attendance_jury', 'planning_detail_jury'])]
- private $members;
- /**
- * @var ArrayCollection<Examen>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\Examen', mappedBy: 'jury')]
- #[Groups(['jury_examen'])]
- private $examens;
- /**
- * @var ArrayCollection<Tagg>
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'juries')]
- #[Assert\Valid]
- #[ORM\JoinTable(name: 'tag_jury', joinColumns: [], inverseJoinColumns: [])]
- #[ORM\JoinColumn(name: 'jury_id', referencedColumnName: 'id')]
- #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- #[Groups(['jury_tags', 'manage_tags'])]
- private $tags;
- public function __construct() {
- $this->members = new ArrayCollection();
- $this->examens = new ArrayCollection();
- $this->tags = new ArrayCollection();
- }
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets organization.
- *
- * @param Organization $organization
- *
- * @return $this
- */
- public function setOrganization(Organization $organization)
- {
- $this->organization = $organization;
- return $this;
- }
- /**
- * Gets organization.
- *
- * @return Organization
- */
- public function getOrganization()
- {
- return $this->organization;
- }
- /**
- * Sets name.
- *
- * @param string $name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Gets name.
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Sets date.
- *
- * @param \DateTime $date
- *
- * @return $this
- */
- public function setDate(\DateTime $date = null)
- {
- $this->date = $date;
- return $this;
- }
- /**
- * Gets date.
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->date;
- }
- /**
- * Gets members.
- *
- * @return ArrayCollection<JuryMember>
- */
- public function getMembers()
- {
- return ($this->members) ? array_values($this->members->toArray()) : new ArrayCollection();
- }
- /**
- * Add member
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $access
- *
- * @return Jury
- */
- public function addMember(\AppBundle\Entity\AccessAndFunction\Access $access)
- {
- $this->members[] = $access;
- return $this;
- }
- /**
- * Remove member
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $access
- */
- public function removeMember(\AppBundle\Entity\AccessAndFunction\Access $access)
- {
- $this->members->removeElement($access);
- }
- /**
- * Add examen
- *
- * @param \AppBundle\Entity\Booking\Examen $examen
- *
- * @return Jury
- */
- 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;
- }
- /**
- * Set endDate
- *
- * @param \DateTime $endDate
- *
- * @return Jury
- */
- public function setEndDate($endDate)
- {
- $this->endDate = $endDate;
- return $this;
- }
- /**
- * Get endDate
- *
- * @return \DateTime
- */
- public function getEndDate()
- {
- return $this->endDate;
- }
- /**
- * Add tag
- *
- * @param \AppBundle\Entity\Core\Tagg $tag
- *
- * @return Jury
- */
- public function addTag(\AppBundle\Entity\Core\Tagg $tag)
- {
- $this->tags[] = $tag;
- return $this;
- }
- /**
- * Remove tag
- *
- * @param \AppBundle\Entity\Core\Tagg $tag
- */
- public function removeTag(\AppBundle\Entity\Core\Tagg $tag)
- {
- $this->tags->removeElement($tag);
- }
- /**
- * Get tags
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getTags()
- {
- return $this->tags;
- }
- }
|