<?php
namespace App\Entity;
use App\Repository\PropertyRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PropertyRepository::class)
*/
class Property
{
const TYPE_CANDIDATURE = "candidature";
const TYPE_EMPLOYE = "employé";
const TYPE_CUSTOMER = "parent";
const TYPE_POST_CANDIDATURE = "postCandidature";
const TYPE_ENFANT = "enfant" ;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity=Property::class, inversedBy="children")
*/
private $parent;
/**
* @ORM\OneToMany(targetEntity=Property::class, mappedBy="parent")
*/
private $children;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $groupContact = [];
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @ORM\OneToMany(targetEntity=ContactPropertyValue::class, mappedBy="property")
*/
private $contactPropertyValues;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $comment;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $default;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $choices = [];
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $factoryType;
/**
* @ORM\ManyToMany(targetEntity=Sejour::class, mappedBy="property")
*/
private $sejours;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isMandatory;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subSubType;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isFactory;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $validationClass;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $postProcess;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pdfValue;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $position;
public function __construct()
{
$this->children = new ArrayCollection();
$this->contactPropertyValues = new ArrayCollection();
$this->sejours = new ArrayCollection();
$this->isMandatory = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getValidationClass(): ?string
{
return $this->validationClass;
}
public function setValidationClass(string $validationClass): self
{
$this->validationClass = $validationClass;
return $this;
}
public function getPostProcess(): ?string
{
return $this->postProcess;
}
public function setPostProcess(string $validationClass): self
{
$this->postProcess = $validationClass;
return $this;
}
public function getPdfValue(): ?string
{
return $this->pdfValue;
}
public function setPdfValue(string $validationClass): self
{
$this->pdfValue = $validationClass;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
/**
* @return Collection|self[]
*/
public function getChildren(): Collection
{
return $this->children;
}
public function addChild(self $child): self
{
if (!$this->children->contains($child)) {
$this->children[] = $child;
$child->setParent($this);
}
return $this;
}
public function removeChild(self $child): self
{
if ($this->children->removeElement($child)) {
// set the owning side to null (unless already changed)
if ($child->getParent() === $this) {
$child->setParent(null);
}
}
return $this;
}
public function getGroupContact(): ?array
{
return $this->groupContact;
}
public function setGroupContact(?array $groupContact): self
{
$this->groupContact = $groupContact;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* @return Collection|ContactPropertyValue[]
*/
public function getContactPropertyValues(): Collection
{
return $this->contactPropertyValues;
}
public function addContactPropertyValue(ContactPropertyValue $contactPropertyValue): self
{
if (!$this->contactPropertyValues->contains($contactPropertyValue)) {
$this->contactPropertyValues[] = $contactPropertyValue;
$contactPropertyValue->setProperty($this);
}
return $this;
}
public function removeContactPropertyValue(ContactPropertyValue $contactPropertyValue): self
{
if ($this->contactPropertyValues->removeElement($contactPropertyValue)) {
// set the owning side to null (unless already changed)
if ($contactPropertyValue->getProperty() === $this) {
$contactPropertyValue->setProperty(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getDefault(): ?string
{
return $this->default;
}
public function setDefault(?string $type): self
{
$this->default = $type;
return $this;
}
public function getChoices(): ?array
{
return $this->choices;
}
public function setChoices(?array $choices): self
{
$this->choices = $choices;
return $this;
}
public function getFactoryType(): ?string
{
return $this->factoryType;
}
public function setFactoryType(?string $factoryType): self
{
$this->factoryType = $factoryType;
return $this;
}
/**
* @return Collection|Sejour[]
*/
public function getSejours(): Collection
{
return $this->sejours;
}
public function addSejour(Sejour $sejour): self
{
if (!$this->sejours->contains($sejour)) {
$this->sejours[] = $sejour;
$sejour->addProperty($this);
}
return $this;
}
public function removeSejour(Sejour $sejour): self
{
if ($this->sejours->removeElement($sejour)) {
$sejour->removeProperty($this);
}
return $this;
}
public function getIsMandatory(): ?bool
{
return $this->isMandatory;
}
public function setIsMandatory(?bool $isMandatory): self
{
$this->isMandatory = $isMandatory;
return $this;
}
public function getSubType(): ?string
{
return $this->subType;
}
public function setSubType(?string $subType): self
{
$this->subType = $subType;
return $this;
}
public function getSubSubType(): ?string
{
return $this->subSubType;
}
public function setSubSubType(?string $subType): self
{
$this->subSubType = $subType;
return $this;
}
public function getIsFactory(): ?bool
{
return $this->isFactory;
}
public function setIsFactory(?bool $isFactory): self
{
$this->isFactory = $isFactory;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(?int $position): self
{
$this->position = $position;
return $this;
}
}