<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* DnsitScoringProfile
*
* @ORM\Table(name="dnsit_scoring_profile")
* @ORM\Entity(repositoryClass="App\Repository\DnsitScoringProfileRepository")
*/
class DnsitScoringProfile
{
/**
* @var string|null
*
* @ORM\Column(name="name", type="string", length=255, nullable=true)
*/
private $name;
/**
* @var string|null
*
* @ORM\Column(name="params", type="text", nullable=true)
*/
private $params;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
/**
* @var \DateTime|null
*
* @ORM\Column(name="created_at", type="datetime", nullable=true)
*/
private $createdAt;
/**
* @var \DateTime|null
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @var int
*
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\DnsitScoring", mappedBy="scoringProfile", cascade={"persist","remove"})
*/
private $scorings;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\DnsitStoredRequest", mappedBy="scoringProfile", cascade={"persist","remove"})
*/
private $requests;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\Selection", mappedBy="score", cascade={"persist","remove"})
*/
private $selections;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebSort", mappedBy="score", cascade={"persist","remove"})
*/
private $sorts;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="scoringProfiles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @var DnsitEntity
*
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="scoringProfiles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="scoringProfiles")
*/
private $tags;
/**
* Constructor
*/
public function __construct()
{
$this->scorings = new \Doctrine\Common\Collections\ArrayCollection();
$this->requests = new \Doctrine\Common\Collections\ArrayCollection();
$this->selections = new ArrayCollection();
$this->sorts = new ArrayCollection();
$this->tags = new ArrayCollection();
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getParams(): ?string
{
return $this->params;
}
public function setParams(?string $params): self
{
$this->params = $params;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
$this->owner = $owner;
return $this;
}
public function getEntity(): ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity): self
{
$this->entity = $entity;
return $this;
}
public function getState(): ?int
{
return $this->state;
}
public function setState(?int $state): self
{
$this->state = $state;
return $this;
}
/**
* @return Collection|DnsitScoring[]
*/
public function getScorings(): Collection
{
return $this->scorings;
}
public function addScoring(DnsitScoring $scoring): self
{
if (!$this->scorings->contains($scoring)) {
$this->scorings[] = $scoring;
$scoring->setScoringProfile($this);
}
return $this;
}
public function removeScoring(DnsitScoring $scoring): self
{
if ($this->scorings->contains($scoring)) {
$this->scorings->removeElement($scoring);
// set the owning side to null (unless already changed)
if ($scoring->getScoringProfile() === $this) {
$scoring->setScoringProfile(null);
}
}
return $this;
}
/**
* @return Collection|DnsitStoredRequest[]
*/
public function getRequests(): Collection
{
return $this->requests;
}
public function addRequest(DnsitStoredRequest $request): self
{
if (!$this->requests->contains($request)) {
$this->requests[] = $request;
$request->setScoringProfile($this);
}
return $this;
}
public function removeRequest(DnsitStoredRequest $request): self
{
if ($this->requests->contains($request)) {
$this->requests->removeElement($request);
// set the owning side to null (unless already changed)
if ($request->getScoringProfile() === $this) {
$request->setScoringProfile(null);
}
}
return $this;
}
/**
* @return Collection|Selection[]
*/
public function getSelections(): Collection
{
return $this->selections;
}
public function addSelection(Selection $selection): self
{
if (!$this->selections->contains($selection)) {
$this->selections[] = $selection;
$selection->setScore($this);
}
return $this;
}
public function removeSelection(Selection $selection): self
{
if ($this->selections->contains($selection)) {
$this->selections->removeElement($selection);
// set the owning side to null (unless already changed)
if ($selection->getScore() === $this) {
$selection->setScore(null);
}
}
return $this;
}
/**
* @return Collection|WebSort[]
*/
public function getSorts(): Collection
{
return $this->sorts;
}
public function addSort(WebSort $sort): self
{
if (!$this->sorts->contains($sort)) {
$this->sorts[] = $sort;
$sort->setScore($this);
}
return $this;
}
public function removeSort(WebSort $sort): self
{
if ($this->sorts->contains($sort)) {
$this->sorts->removeElement($sort);
// set the owning side to null (unless already changed)
if ($sort->getScore() === $this) {
$sort->setScore(null);
}
}
return $this;
}
/**
* @return Collection|Tag[]
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tag $tag): self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tag $tag): self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
}