<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass="App\Repository\AnnonceSpaceRepository")
*/
class AnnonceSpace
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private ?int $id;
/**
* @ORM\Column(type="string", length=255)
*/
private ?string $name;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?DateTime $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?DateTime $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private ?int $state;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private ?bool $hasDynamicAnnonces;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TagAnnonce", inversedBy="annonceSpaces")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tag_annonce_id", referencedColumnName="id")
* })
*/
private ?TagAnnonce $tagAnnonce;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Annonce", inversedBy="annonceSpaces")
*/
private $annonces;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="annonceSpaces")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="annonceSpaces")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
public function __construct()
{
$this->annonces = new ArrayCollection();
}
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 getTagAnnonce() : ?TagAnnonce
{
return $this->tagAnnonce;
}
public function setTagAnnonce(?TagAnnonce $tagAnnonce) : self
{
$this->tagAnnonce = $tagAnnonce;
return $this;
}
/**
* @return Collection|Annonce[]
*/
public function getAnnonces() : Collection
{
return $this->annonces;
}
public function addAnnonce(Annonce $annonce) : self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
}
return $this;
}
public function removeAnnonce(Annonce $annonce) : self
{
if ($this->annonces->contains($annonce)) {
$this->annonces->removeElement($annonce);
}
return $this;
}
public function getCreatedAt() : ?DateTime
{
return $this->createdAt;
}
public function setCreatedAt(?DateTime $createdAt) : self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt() : ?DateTime
{
return $this->updatedAt;
}
public function setUpdatedAt(?DateTime $updatedAt) : self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState() : ?int
{
return $this->state;
}
public function setState(?int $state) : self
{
$this->state = $state;
return $this;
}
public function getHasDynamicAnnonces(): ?bool
{
return $this->hasDynamicAnnonces;
}
public function setHasDynamicAnnonces(?bool $hasDynamicAnnonces): self
{
$this->hasDynamicAnnonces = $hasDynamicAnnonces;
return $this;
}
}