<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\PlaceDeMarcheRepository")
*/
class PlaceDeMarche
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $password;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cout;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $identifiant;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Lead", mappedBy="marche")
*/
private $leads;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="placeDeMarches")
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Status", inversedBy="placeDeMarches")
*/
private $status;
/**
* @ORM\OneToMany(targetEntity="App\Entity\TraitementDsDemdDachat", mappedBy="place_de_marche")
*/
private $traitementDsDemdDachats;
public function __construct()
{
$this->leads = new ArrayCollection();
$this->createdAt = new \DateTime('now');
$this->traitementDsDemdDachats = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection|Lead[]
*/
public function getLeads(): Collection
{
return $this->leads;
}
public function addLead(Lead $lead): self
{
if (!$this->leads->contains($lead)) {
$this->leads[] = $lead;
$lead->setMarche($this);
}
return $this;
}
public function removeLead(Lead $lead): self
{
if ($this->leads->contains($lead)) {
$this->leads->removeElement($lead);
// set the owning side to null (unless already changed)
if ($lead->getMarche() === $this) {
$lead->setMarche(null);
}
}
return $this;
}
/**
* @return mixed
*/
public function getPassword()
{
return $this->password;
}
/**
* @param mixed $password
* @return PlaceDeMarche
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* @return mixed
*/
public function getCout()
{
return $this->cout;
}
/**
* @param mixed $cout
* @return PlaceDeMarche
*/
public function setCout($cout)
{
$this->cout = $cout;
return $this;
}
/**
* @return mixed
*/
public function getUtilisateur()
{
return $this->utilisateur;
}
/**
* @param mixed $utilisateur
* @return PlaceDeMarche
*/
public function setUtilisateur($utilisateur)
{
$this->utilisateur = $utilisateur;
return $this;
}
/**
* @return mixed
*/
public function getIdentifiant()
{
return $this->identifiant;
}
/**
* @param mixed $identifiant
* @return PlaceDeMarche
*/
public function setIdentifiant($identifiant)
{
$this->identifiant = $identifiant;
return $this;
}
public function __toString(){
return $this->nom;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection|TraitementDsDemdDachat[]
*/
public function getTraitementDsDemdDachats(): Collection
{
return $this->traitementDsDemdDachats;
}
public function addTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
{
if (!$this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
$this->traitementDsDemdDachats[] = $traitementDsDemdDachat;
$traitementDsDemdDachat->setPlaceDeMarche($this);
}
return $this;
}
public function removeTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
{
if ($this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
$this->traitementDsDemdDachats->removeElement($traitementDsDemdDachat);
// set the owning side to null (unless already changed)
if ($traitementDsDemdDachat->getPlaceDeMarche() === $this) {
$traitementDsDemdDachat->setPlaceDeMarche(null);
}
}
return $this;
}
}