src/Entity/DnsitScoringProfile.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * DnsitScoringProfile
  8.  *
  9.  * @ORM\Table(name="dnsit_scoring_profile")
  10.  * @ORM\Entity(repositoryClass="App\Repository\DnsitScoringProfileRepository")
  11.  */
  12. class DnsitScoringProfile
  13. {
  14.     /**
  15.      * @var string|null
  16.      *
  17.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @var string|null
  22.      *
  23.      * @ORM\Column(name="params", type="text", nullable=true)
  24.      */
  25.     private $params;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  28.      */
  29.     private $state;
  30.     /**
  31.      * @var \DateTime|null
  32.      *
  33.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  34.      */
  35.     private $createdAt;
  36.     /**
  37.      * @var \DateTime|null
  38.      *
  39.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @var int
  44.      *
  45.      * @ORM\Column(name="id", type="bigint")
  46.      * @ORM\Id
  47.      * @ORM\GeneratedValue(strategy="IDENTITY")
  48.      */
  49.     private $id;
  50.     /**
  51.      * @var \Doctrine\Common\Collections\Collection
  52.      *
  53.      * @ORM\OneToMany(targetEntity="App\Entity\DnsitScoring", mappedBy="scoringProfile", cascade={"persist","remove"})
  54.      */
  55.     private $scorings;
  56.     /**
  57.      * @var \Doctrine\Common\Collections\Collection
  58.      *
  59.      * @ORM\OneToMany(targetEntity="App\Entity\DnsitStoredRequest", mappedBy="scoringProfile", cascade={"persist","remove"})
  60.      */
  61.     private $requests;
  62.     /**
  63.      * @var \Doctrine\Common\Collections\Collection
  64.      *
  65.      * @ORM\OneToMany(targetEntity="App\Entity\Selection", mappedBy="score", cascade={"persist","remove"})
  66.      */
  67.     private $selections;
  68.     /**
  69.      * @var \Doctrine\Common\Collections\Collection
  70.      *
  71.      * @ORM\OneToMany(targetEntity="App\Entity\WebSort", mappedBy="score", cascade={"persist","remove"})
  72.      */
  73.     private $sorts;
  74.     /**
  75.      * @var User
  76.      *
  77.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="scoringProfiles")
  78.      * @ORM\JoinColumns({
  79.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  80.      * })
  81.      */
  82.     private $owner;
  83.     /**
  84.      * @var DnsitEntity
  85.      *
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="scoringProfiles")
  87.      * @ORM\JoinColumns({
  88.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  89.      * })
  90.      */
  91.     private $entity;
  92.     /**
  93.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="scoringProfiles")
  94.      */
  95.     private $tags;
  96.     /**
  97.      * Constructor
  98.      */
  99.     public function __construct()
  100.     {
  101.         $this->scorings = new \Doctrine\Common\Collections\ArrayCollection();
  102.         $this->requests = new \Doctrine\Common\Collections\ArrayCollection();
  103.         $this->selections = new ArrayCollection();
  104.         $this->sorts = new ArrayCollection();
  105.         $this->tags = new ArrayCollection();
  106.     }
  107.     public function getName(): ?string
  108.     {
  109.         return $this->name;
  110.     }
  111.     public function setName(?string $name): self
  112.     {
  113.         $this->name $name;
  114.         return $this;
  115.     }
  116.     public function getParams(): ?string
  117.     {
  118.         return $this->params;
  119.     }
  120.     public function setParams(?string $params): self
  121.     {
  122.         $this->params $params;
  123.         return $this;
  124.     }
  125.     public function getCreatedAt(): ?\DateTimeInterface
  126.     {
  127.         return $this->createdAt;
  128.     }
  129.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  130.     {
  131.         $this->createdAt $createdAt;
  132.         return $this;
  133.     }
  134.     public function getUpdatedAt(): ?\DateTimeInterface
  135.     {
  136.         return $this->updatedAt;
  137.     }
  138.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  139.     {
  140.         $this->updatedAt $updatedAt;
  141.         return $this;
  142.     }
  143.     public function getId(): ?int
  144.     {
  145.         return $this->id;
  146.     }
  147.     public function getOwner(): ?User
  148.     {
  149.         return $this->owner;
  150.     }
  151.     public function setOwner(?User $owner): self
  152.     {
  153.         $this->owner $owner;
  154.         return $this;
  155.     }
  156.     public function getEntity(): ?DnsitEntity
  157.     {
  158.         return $this->entity;
  159.     }
  160.     public function setEntity(?DnsitEntity $entity): self
  161.     {
  162.         $this->entity $entity;
  163.         return $this;
  164.     }
  165.     public function getState(): ?int
  166.     {
  167.         return $this->state;
  168.     }
  169.     public function setState(?int $state): self
  170.     {
  171.         $this->state $state;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return Collection|DnsitScoring[]
  176.      */
  177.     public function getScorings(): Collection
  178.     {
  179.         return $this->scorings;
  180.     }
  181.     public function addScoring(DnsitScoring $scoring): self
  182.     {
  183.         if (!$this->scorings->contains($scoring)) {
  184.             $this->scorings[] = $scoring;
  185.             $scoring->setScoringProfile($this);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removeScoring(DnsitScoring $scoring): self
  190.     {
  191.         if ($this->scorings->contains($scoring)) {
  192.             $this->scorings->removeElement($scoring);
  193.             // set the owning side to null (unless already changed)
  194.             if ($scoring->getScoringProfile() === $this) {
  195.                 $scoring->setScoringProfile(null);
  196.             }
  197.         }
  198.         return $this;
  199.     }
  200.     /**
  201.      * @return Collection|DnsitStoredRequest[]
  202.      */
  203.     public function getRequests(): Collection
  204.     {
  205.         return $this->requests;
  206.     }
  207.     public function addRequest(DnsitStoredRequest $request): self
  208.     {
  209.         if (!$this->requests->contains($request)) {
  210.             $this->requests[] = $request;
  211.             $request->setScoringProfile($this);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeRequest(DnsitStoredRequest $request): self
  216.     {
  217.         if ($this->requests->contains($request)) {
  218.             $this->requests->removeElement($request);
  219.             // set the owning side to null (unless already changed)
  220.             if ($request->getScoringProfile() === $this) {
  221.                 $request->setScoringProfile(null);
  222.             }
  223.         }
  224.         return $this;
  225.     }
  226.     /**
  227.      * @return Collection|Selection[]
  228.      */
  229.     public function getSelections(): Collection
  230.     {
  231.         return $this->selections;
  232.     }
  233.     public function addSelection(Selection $selection): self
  234.     {
  235.         if (!$this->selections->contains($selection)) {
  236.             $this->selections[] = $selection;
  237.             $selection->setScore($this);
  238.         }
  239.         return $this;
  240.     }
  241.     public function removeSelection(Selection $selection): self
  242.     {
  243.         if ($this->selections->contains($selection)) {
  244.             $this->selections->removeElement($selection);
  245.             // set the owning side to null (unless already changed)
  246.             if ($selection->getScore() === $this) {
  247.                 $selection->setScore(null);
  248.             }
  249.         }
  250.         return $this;
  251.     }
  252.     /**
  253.      * @return Collection|WebSort[]
  254.      */
  255.     public function getSorts(): Collection
  256.     {
  257.         return $this->sorts;
  258.     }
  259.     public function addSort(WebSort $sort): self
  260.     {
  261.         if (!$this->sorts->contains($sort)) {
  262.             $this->sorts[] = $sort;
  263.             $sort->setScore($this);
  264.         }
  265.         return $this;
  266.     }
  267.     public function removeSort(WebSort $sort): self
  268.     {
  269.         if ($this->sorts->contains($sort)) {
  270.             $this->sorts->removeElement($sort);
  271.             // set the owning side to null (unless already changed)
  272.             if ($sort->getScore() === $this) {
  273.                 $sort->setScore(null);
  274.             }
  275.         }
  276.         return $this;
  277.     }
  278.     /**
  279.      * @return Collection|Tag[]
  280.      */
  281.     public function getTags(): Collection
  282.     {
  283.         return $this->tags;
  284.     }
  285.     public function addTag(Tag $tag): self
  286.     {
  287.         if (!$this->tags->contains($tag)) {
  288.             $this->tags[] = $tag;
  289.         }
  290.         return $this;
  291.     }
  292.     public function removeTag(Tag $tag): self
  293.     {
  294.         if ($this->tags->contains($tag)) {
  295.             $this->tags->removeElement($tag);
  296.         }
  297.         return $this;
  298.     }
  299. }