src\Entity\Contenupartenaire.php line 12

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. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. #[ORM\Entity(repositoryClass\App\Repository\ContenupartenaireRepository::class)]
  9. class Contenupartenaire
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255)]
  16.     private $nom;
  17.     #[ORM\Column(type'text'nullabletrue)]
  18.     private $presentation;
  19.     #[ORM\Column(type'text'nullabletrue)]
  20.     private $description;
  21.     #[ORM\Column(type'string')]
  22.     private $logo;
  23.     #[ORM\Column(type'boolean')]
  24.     private $status;
  25.     #[ORM\Column(type'datetime')]
  26.     private $create_at;
  27.     #[ORM\Column(type'datetime'nullabletrue)]
  28.     private $update_at;
  29.     #[ORM\OneToMany(targetEntityProduit::class, mappedBy'partenaire')]
  30.     private $produit;
  31.     function __construct()
  32.     {
  33.         $this->status=true;
  34.         //$this->roles = ['ROLE_USER'];
  35.         $this->create_at=new \DateTime('UTC');
  36.         //$this->loginattemps = new ArrayCollection();
  37.         //$this->trackings = new ArrayCollection();
  38.         $this->produit = new ArrayCollection();    }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getNom(): ?string
  44.     {
  45.         return $this->nom;
  46.     }
  47.     public function setNom(string $nom): self
  48.     {
  49.         $this->nom $nom;
  50.         return $this;
  51.     }
  52.     public function getPresentation(): ?string
  53.     {
  54.         return $this->presentation;
  55.     }
  56.     public function setPresentation(?string $presentation): self
  57.     {
  58.         $this->presentation $presentation;
  59.         return $this;
  60.     }
  61.     public function getDescription(): ?string
  62.     {
  63.         return $this->description;
  64.     }
  65.     public function setDescription(?string $description): self
  66.     {
  67.         $this->description $description;
  68.         return $this;
  69.     }
  70.     public function getLogo()
  71.     {
  72.         return $this->logo;
  73.     }
  74.     public function setLogo($logo)
  75.     {
  76.         $this->logo $logo;
  77.         return $this;
  78.     }
  79.     public function getStatus(): ?bool
  80.     {
  81.         return $this->status;
  82.     }
  83.     public function setStatus(bool $status): self
  84.     {
  85.         $this->status $status;
  86.         return $this;
  87.     }
  88.     public function getCreateAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->create_at;
  91.     }
  92.     public function setCreateAt(\DateTimeInterface $create_at): self
  93.     {
  94.         $this->create_at $create_at;
  95.         return $this;
  96.     }
  97.     public function getUpdateAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->update_at;
  100.     }
  101.     public function setUpdateAt(?\DateTimeInterface $update_at): self
  102.     {
  103.         $this->update_at $update_at;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection|Produit[]
  108.      */
  109.     public function getProduit(): Collection
  110.     {
  111.         return $this->produit;
  112.     }
  113.     public function addProduit(Produit $produit): self
  114.     {
  115.         if (!$this->produit->contains($produit)) {
  116.             $this->produit[] = $produit;
  117.             $produit->setPartenaire($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeProduit(Produit $produit): self
  122.     {
  123.         if ($this->produit->contains($produit)) {
  124.             $this->produit->removeElement($produit);
  125.             // set the owning side to null (unless already changed)
  126.             if ($produit->getPartenaire() === $this) {
  127.                 $produit->setPartenaire(null);
  128.             }
  129.         }
  130.         return $this;
  131.     }
  132. }