src/Flexy/ShopBundle/Entity/Vendor/Vendor.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Vendor;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Entity\User;
  5. use App\Flexy\ShopBundle\Entity\Product\ImportExcel;
  6. use App\Flexy\ShopBundle\Entity\Product\Product;
  7. use App\Flexy\ShopBundle\Entity\Product\ProductShop;
  8. use App\Flexy\ShopBundle\Repository\VendorRepository;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  13. use Symfony\Component\HttpFoundation\File\File;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. /**
  16.  * @ORM\Entity(repositoryClass=VendorRepository::class)
  17.  * @Vich\Uploadable
  18.  */
  19. #[ApiResource]
  20. class Vendor
  21. {
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $image;
  36.     /**
  37.      * @ORM\Column(type="datetime_immutable", nullable=true)
  38.      */
  39.     private $createdAt;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      * @Assert\Email()
  43.      */
  44.     private $email;
  45.     /**
  46.      * @ORM\OneToOne(targetEntity=User::class, cascade={"persist", "remove"})
  47.      * @ORM\JoinColumn(nullable=false)
  48.      */
  49.     private $user;
  50.     /**
  51.      * @ORM\Column(type="text", nullable=true)
  52.      */
  53.     private $description;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=true)
  56.      */
  57.     private $isValid;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="vendor")
  60.      */
  61.     private $products;
  62.     /**
  63.      * @ORM\Column(type="string", length=255)
  64.      */
  65.     private $fullName;
  66.     /**
  67.      * @ORM\Column(type="string", length=255)
  68.      */
  69.     private $tel;
  70.     /**
  71.      * @ORM\Column(type="string", length=255)
  72.      */
  73.     private $address;
  74.     /**
  75.      * @ORM\Column(type="string", length=255)
  76.      */
  77.     private $city;
  78.     /**
  79.      * @ORM\Column(type="string", length=255,nullable=true)
  80.      */
  81.     private $ICE;
  82.     /**
  83.      * @ORM\Column(type="string", length=255,nullable=true)
  84.      */
  85.     private $RC;
  86.     /**
  87.      * @ORM\Column(type="string", length=255)
  88.      */
  89.     private $simulateUsername;
  90.     /**
  91.      * @ORM\Column(type="string", length=255,nullable=true)
  92.      */
  93.     private $simulatePassword;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private $coverImage;
  98.     /**
  99.      * @Vich\UploadableField(mapping="join_images", fileNameProperty="pathRCImage")
  100.      * @var File
  101.      */
  102.     private $imageRCFile;
  103.      /**
  104.      * @Vich\UploadableField(mapping="join_images", fileNameProperty="pathCVImage")
  105.      * @var File
  106.      */
  107.     private $imageCVFile;
  108.      /**
  109.      * @Vich\UploadableField(mapping="join_images", fileNameProperty="pathCERTImage")
  110.      * @var File
  111.      */
  112.     private $imageCERTFile;
  113.         /**
  114.      * @Vich\UploadableField(mapping="join_images", fileNameProperty="pathIceImage")
  115.      * @var File
  116.      */
  117.     private $imageIceFile;
  118.         /**
  119.      * @Vich\UploadableField(mapping="join_images", fileNameProperty="pathIFIMAGE")
  120.      * @var File
  121.      */
  122.     private $imageIFFile;
  123.     /**
  124.      * @ORM\Column(type="string", length=255, nullable=true)
  125.      */
  126.     private $pathCERTImage;
  127.      /**
  128.      * @ORM\Column(type="string", length=255, nullable=true)
  129.      */
  130.     private $pathCVImage;
  131.     /**
  132.      * @ORM\Column(type="string", length=255, nullable=true)
  133.      */
  134.     private $pathRCImage;
  135.     /**
  136.      * @ORM\Column(type="string", length=255, nullable=true)
  137.      */
  138.     private $pathIceImage;
  139.     /**
  140.      * @ORM\Column(type="string", length=255, nullable=true)
  141.      */
  142.     private $pathIFImage;
  143.     /**
  144.      * @ORM\Column(type="string", length=255, nullable=true)
  145.      */
  146.     private $IdentifiantFiscale;
  147.     /**
  148.      * @ORM\OneToMany(targetEntity=ImportExcel::class, mappedBy="vendor")
  149.      */
  150.     private $importExcels;
  151.     /**
  152.      * @ORM\Column(type="string", length=255, nullable=true)
  153.      */
  154.     private $identity_card;
  155.     /**
  156.      * @ORM\Column(type="string", length=255, nullable=true)
  157.      */
  158.     private $bank_details;
  159.     /**
  160.      * @ORM\Column(type="string", length=255, nullable=true)
  161.      */
  162.     private $address_collecte;
  163.     /**
  164.      * @ORM\Column(type="boolean", nullable=true)
  165.      */
  166.     private $delivery_intra;
  167.     /**
  168.      * @ORM\Column(type="boolean", nullable=true)
  169.      */
  170.     private $delivery_inter;
  171.     /**
  172.      * @ORM\OneToMany(targetEntity=deliverycity::class, mappedBy="vendor",cascade={"persist"}) 
  173.      */
  174.     private $deliverycities;
  175.     /**
  176.      * @ORM\Column(type="float", nullable=true)
  177.      */
  178.     private $limited_amount;
  179.     /**
  180.      * @ORM\Column(type="string", nullable=true)
  181.      */
  182.     private $num_rib;
  183.     public function __toString()
  184.     {
  185.        return (string)$this->name;
  186.     }
  187.     public function __construct()
  188.     {
  189.         $this->user = new User();
  190.         $this->products = new ArrayCollection();
  191.         $this->categoryProducts = new ArrayCollection();
  192.         $this->importExcels = new ArrayCollection();
  193.         $this->deliverycities = new ArrayCollection();
  194.     }
  195.     public function getId(): ?int
  196.     {
  197.         return $this->id;
  198.     }
  199.     public function getName(): ?string
  200.     {
  201.         return $this->name;
  202.     }
  203.     public function setName(string $name): self
  204.     {
  205.         $this->name $name;
  206.         return $this;
  207.     }
  208.     public function getImage(): ?string
  209.     {
  210.         return $this->image;
  211.     }
  212.     public function setImage(?string $image): self
  213.     {
  214.         $this->image $image;
  215.         return $this;
  216.     }
  217.     public function getCreatedAt(): ?\DateTimeImmutable
  218.     {
  219.         return $this->createdAt;
  220.     }
  221.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  222.     {
  223.         $this->createdAt $createdAt;
  224.         return $this;
  225.     }
  226.     public function getEmail(): ?string
  227.     {
  228.         return $this->email;
  229.     }
  230.     public function setEmail(?string $email): self
  231.     {
  232.         $this->email $email;
  233.         return $this;
  234.     }
  235.     public function getUser(): ?User
  236.     {
  237.         return $this->user;
  238.     }
  239.     public function setUser(User $user): self
  240.     {
  241.         $this->user $user;
  242.         return $this;
  243.     }
  244.    
  245.     public function getDescription(): ?string
  246.     {
  247.         return $this->description;
  248.     }
  249.     public function setDescription(?string $description): self
  250.     {
  251.         $this->description $description;
  252.         return $this;
  253.     }
  254.     public function getIsValid(): ?bool
  255.     {
  256.         return $this->isValid;
  257.     }
  258.     public function setIsValid(?bool $isValid): self
  259.     {
  260.         $this->isValid $isValid;
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return Collection|Product[]
  265.      */
  266.     public function getProducts(): Collection
  267.     {
  268.         return $this->products;
  269.     }
  270.     public function addProduct(Product $product): self
  271.     {
  272.         if (!$this->products->contains($product)) {
  273.             $this->products[] = $product;
  274.             $product->setVendor($this);
  275.         }
  276.         return $this;
  277.     }
  278.     public function removeProduct(Product $product): self
  279.     {
  280.         if ($this->products->removeElement($product)) {
  281.             // set the owning side to null (unless already changed)
  282.             if ($product->getVendor() === $this) {
  283.                 $product->setVendor(null);
  284.             }
  285.         }
  286.         return $this;
  287.     }
  288.     public function getFullName(): ?string
  289.     {
  290.         return $this->fullName;
  291.     }
  292.     public function setFullName(string $fullName): self
  293.     {
  294.         $this->fullName $fullName;
  295.         return $this;
  296.     }
  297.     public function getTel(): ?string
  298.     {
  299.         return $this->tel;
  300.     }
  301.     public function setTel(string $tel): self
  302.     {
  303.         $this->tel $tel;
  304.         return $this;
  305.     }
  306.     public function getAddress(): ?string
  307.     {
  308.         return $this->address;
  309.     }
  310.     public function setAddress(string $address): self
  311.     {
  312.         $this->address $address;
  313.         return $this;
  314.     }
  315.     public function getCity(): ?string
  316.     {
  317.         return $this->city;
  318.     }
  319.     public function setCity(string $city): self
  320.     {
  321.         $this->city $city;
  322.         return $this;
  323.     }
  324.     public function getICE(): ?string
  325.     {
  326.         return $this->ICE;
  327.     }
  328.     public function setICE(string $ICE): self
  329.     {
  330.         $this->ICE $ICE;
  331.         return $this;
  332.     }
  333.     public function getRC(): ?string
  334.     {
  335.         return $this->RC;
  336.     }
  337.     public function setRC(string $RC): self
  338.     {
  339.         $this->RC $RC;
  340.         return $this;
  341.     }
  342.     public function getSimulateUsername(): ?string
  343.     {
  344.         return $this->simulateUsername;
  345.     }
  346.     public function setSimulateUsername(string $simulateUsername): self
  347.     {
  348.         $this->simulateUsername $simulateUsername;
  349.         return $this;
  350.     }
  351.     public function getSimulatePassword(): ?string
  352.     {
  353.         return $this->simulatePassword;
  354.     }
  355.     public function setSimulatePassword(string $simulatePassword): self
  356.     {
  357.         $this->simulatePassword $simulatePassword;
  358.         return $this;
  359.     }
  360.     public function getCoverImage(): ?string
  361.     {
  362.         return $this->coverImage;
  363.     }
  364.     public function setCoverImage(?string $coverImage): self
  365.     {
  366.         $this->coverImage $coverImage;
  367.         return $this;
  368.     }
  369.     public function setImageRCFile(File $path null)
  370.     {
  371.         $this->imageRCFile $path;
  372.         // VERY IMPORTANT:
  373.         // It is required that at least one field changes if you are using Doctrine,
  374.         // otherwise the event listeners won't be called and the file is lost
  375.     }
  376.     public function getImageCVFile()
  377.     {
  378.         return $this->imageCVFile;
  379.     }
  380.     public function setImageCVFile(File $path null)
  381.     {
  382.         $this->imageCVFile $path;
  383.         // VERY IMPORTANT:
  384.         // It is required that at least one field changes if you are using Doctrine,
  385.         // otherwise the event listeners won't be called and the file is lost
  386.     }
  387.     public function getImageCERTFile()
  388.     {
  389.         return $this->imageCERTFile;
  390.     }
  391.     public function setImageCERTFile(File $path null)
  392.     {
  393.         $this->imageCERTFile $path;
  394.         // VERY IMPORTANT:
  395.         // It is required that at least one field changes if you are using Doctrine,
  396.         // otherwise the event listeners won't be called and the file is lost
  397.     }
  398.     public function getImageRCFile()
  399.     {
  400.         return $this->imageRCFile;
  401.     }
  402.     public function setImageIceFile(File $path null)
  403.     {
  404.         $this->imageIceFile $path;
  405.         // VERY IMPORTANT:
  406.         // It is required that at least one field changes if you are using Doctrine,
  407.         // otherwise the event listeners won't be called and the file is lost
  408.     }
  409.     public function getImageIceFile()
  410.     {
  411.         return $this->imageIceFile;
  412.     }
  413.     public function setImageIFFile(File $path null)
  414.     {
  415.         $this->imageIFFile $path;
  416.         // VERY IMPORTANT:
  417.         // It is required that at least one field changes if you are using Doctrine,
  418.         // otherwise the event listeners won't be called and the file is lost
  419.  
  420.     }
  421.     public function getImageIFFile()
  422.     {
  423.         return $this->imageIFFile;
  424.     }
  425.     public function getPathRCImage(): ?string
  426.     {
  427.         return $this->pathRCImage;
  428.     }
  429.     public function setPathRCImage(?string $pathRCImage): self
  430.     {
  431.         $this->pathRCImage $pathRCImage;
  432.         return $this;
  433.     }
  434.     public function getPathCVImage(): ?string
  435.     {
  436.         return $this->pathCVImage;
  437.     }
  438.     public function setPathCVImage(?string $pathCVImage): self
  439.     {
  440.         $this->pathCVImage $pathCVImage;
  441.         return $this;
  442.     }
  443.     
  444.     public function getPathCERTImage(): ?string
  445.     {
  446.         return $this->pathCERTImage;
  447.     }
  448.     public function setPathCERTImage(?string $pathCERTImage): self
  449.     {
  450.         $this->pathCERTImage $pathCERTImage;
  451.         return $this;
  452.     }
  453.     public function getPathIceImage(): ?string
  454.     {
  455.         return $this->pathIceImage;
  456.     }
  457.     public function setPathIceImage(?string $pathIceImage): self
  458.     {
  459.         $this->pathIceImage $pathIceImage;
  460.         return $this;
  461.     }
  462.     public function getPathIFImage(): ?string
  463.     {
  464.         return $this->pathIFImage;
  465.     }
  466.     public function setPathIFImage(?string $pathIFImage): self
  467.     {
  468.         $this->pathIFImage $pathIFImage;
  469.         return $this;
  470.     }
  471.     public function getIdentifiantFiscale(): ?string
  472.     {
  473.         return $this->IdentifiantFiscale;
  474.     }
  475.     public function setIdentifiantFiscale(?string $IdentifiantFiscale): self
  476.     {
  477.         $this->IdentifiantFiscale $IdentifiantFiscale;
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return Collection<int, ImportExcel>
  482.      */
  483.     public function getImportExcels(): Collection
  484.     {
  485.         return $this->importExcels;
  486.     }
  487.     public function addImportExcel(ImportExcel $importExcel): self
  488.     {
  489.         if (!$this->importExcels->contains($importExcel)) {
  490.             $this->importExcels[] = $importExcel;
  491.             $importExcel->setVendor($this);
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeImportExcel(ImportExcel $importExcel): self
  496.     {
  497.         if ($this->importExcels->removeElement($importExcel)) {
  498.             // set the owning side to null (unless already changed)
  499.             if ($importExcel->getVendor() === $this) {
  500.                 $importExcel->setVendor(null);
  501.             }
  502.         }
  503.         return $this;
  504.     }
  505.     public function getIdentityCard(): ?string
  506.     {
  507.         return $this->identity_card;
  508.     }
  509.     public function setIdentityCard(?string $identity_card): self
  510.     {
  511.         $this->identity_card $identity_card;
  512.         return $this;
  513.     }
  514.     public function getBankDetails(): ?string
  515.     {
  516.         return $this->bank_details;
  517.     }
  518.     public function setBankDetails(?string $bank_details): self
  519.     {
  520.         $this->bank_details $bank_details;
  521.         return $this;
  522.     }
  523.     public function getAddressCollecte(): ?string
  524.     {
  525.         return $this->address_collecte;
  526.     }
  527.     public function setAddressCollecte(?string $address_collecte): self
  528.     {
  529.         $this->address_collecte $address_collecte;
  530.         return $this;
  531.     }
  532.     public function getDeliveryIntra(): ?bool
  533.     {
  534.         return $this->delivery_intra;
  535.     }
  536.     public function setDeliveryIntra(?bool $delivery_intra): self
  537.     {
  538.         $this->delivery_intra $delivery_intra;
  539.         return $this;
  540.     }
  541.     public function getDeliveryInter(): ?bool
  542.     {
  543.         return $this->delivery_inter;
  544.     }
  545.     public function setDeliveryInter(?bool $delivery_inter): self
  546.     {
  547.         $this->delivery_inter $delivery_inter;
  548.         return $this;
  549.     }
  550.     /**
  551.      * @return Collection<int, deliverycity>
  552.      */
  553.     public function getDeliverycities(): Collection
  554.     {
  555.         return $this->deliverycities;
  556.     }
  557.     public function addDeliverycity(deliverycity $deliverycity): self
  558.     {
  559.         if (!$this->deliverycities->contains($deliverycity)) {
  560.             $this->deliverycities[] = $deliverycity;
  561.             $deliverycity->setVendor($this);
  562.         }
  563.         return $this;
  564.     }
  565.     public function removeDeliverycity(deliverycity $deliverycity): self
  566.     {
  567.         if ($this->deliverycities->removeElement($deliverycity)) {
  568.             // set the owning side to null (unless already changed)
  569.             if ($deliverycity->getVendor() === $this) {
  570.                 $deliverycity->setVendor(null);
  571.             }
  572.         }
  573.         return $this;
  574.     }
  575.     public function getLimitedAmount(): ?float
  576.     {
  577.         return $this->limited_amount;
  578.     }
  579.     public function setLimitedAmount(?float $limited_amount): self
  580.     {
  581.         $this->limited_amount $limited_amount;
  582.         return $this;
  583.     }
  584.     public function getNumRib(): ?string
  585.     {
  586.         return $this->num_rib;
  587.     }
  588.     public function setNumRib(?string $num_rib): self
  589.     {
  590.         $this->num_rib $num_rib;
  591.         return $this;
  592.     }
  593. }