src/Entity/Company.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Model\TranslationModel;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClass'App\Repository\CompanyRepository')]
  9. #[ORM\Table(name'company')]
  10. class Company extends User
  11. {
  12.     #[ORM\Column(name'name'type'string'length255)]
  13.     #[Groups(['company''category''favorite'])]
  14.     protected $name;
  15.     #[ORM\Column(name'certification'type'string'length255nullabletrue)]
  16.     #[Groups(['company''category'])]
  17.     protected $certification;
  18.     #[ORM\Column(name'niveau'type'string'length255)]
  19.     #[Groups(['company''category'])]
  20.     protected $niveau;
  21.     #[ORM\Column(name'influencezone'type'string'length255)]
  22.     #[Groups(['company''category'])]
  23.     protected $influencezone;
  24.     #[ORM\Column(name'street'type'string'length255)]
  25.     #[Groups(['company''category'])]
  26.     protected $street;
  27.     #[ORM\Column(name'streetnumber'type'string'length255nullabletrue)]
  28.     #[Groups(['company''category'])]
  29.     protected $streetnumber;
  30.     #[ORM\Column(name'postcode'type'string'length255)]
  31.     #[Groups(['company''category'])]
  32.     protected $postcode;
  33.     #[ORM\Column(name'city'type'string'length255)]
  34.     #[Groups(['company''category'])]
  35.     protected $city;
  36.     #[ORM\Column(name'region'type'string'length255)]
  37.     #[Groups(['company''category'])]
  38.     protected $region;
  39.     #[ORM\Column(name'country'type'string'length255)]
  40.     #[Groups(['company''category'])]
  41.     protected $country;
  42.     #[ORM\Column(name'phone'type'string'length255)]
  43.     #[Groups(['company''category'])]
  44.     protected $phone;
  45.     #[ORM\Column(name'wantevaluation'type'boolean')]
  46.     #[Groups(['company''category'])]
  47.     protected $wantevaluation;
  48.     #[ORM\Column(name'description'type'text')]
  49.     #[Groups(['company''category'])]
  50.     protected $description;
  51.     #[ORM\Column(name'vision'type'text')]
  52.     #[Groups(['company''category'])]
  53.     protected $vision;
  54.     #[ORM\Column(name'socialreason'type'text')]
  55.     #[Groups(['company''category'])]
  56.     protected $socialreason;
  57.     #[ORM\Column(name'urlwebsite'type'string'length255nullabletrue)]
  58.     #[Groups(['company''category'])]
  59.     protected $urlwebsite;
  60.     #[ORM\Column(name'urlfacebook'type'string'length255nullabletrue)]
  61.     #[Groups(['company''category'])]
  62.     protected $urlfacebook;
  63.     #[ORM\Column(name'urltwitter'type'string'length255nullabletrue)]
  64.     #[Groups(['company''category'])]
  65.     protected $urltwitter;
  66.     #[ORM\Column(name'urllinkedin'type'string'length255nullabletrue)]
  67.     #[Groups(['company''category'])]
  68.     protected $urllinkedin;
  69.     #[ORM\Column(name'slug'type'string'length255)]
  70.     #[Groups(['company''category'])]
  71.     protected $slug;
  72.     #[ORM\Column(name'starting_date'type'date'nullabletrue)]
  73.     #[Groups(['company''category'])]
  74.     protected $startingdate;
  75.     #[ORM\Column(name'package'type'smallint'nullabletrue)]
  76.     #[Groups(['company''category'])]
  77.     protected $package;
  78.     #[ORM\Column(name'image'type'string'length255nullabletrue)]
  79.     #[Groups(['company''category''favorite'])]
  80.     protected $image;
  81.     #[ORM\Column(name'latitude'type'float')]
  82.     #[Groups(['company''category'])]
  83.     protected $latitude;
  84.     #[ORM\Column(name'longtitude'type'float')]
  85.     #[Groups(['company''category'])]
  86.     protected $longtitude;
  87.     #[ORM\Column(type'boolean')]
  88.     #[Groups(['company''category'])]
  89.     protected $activated false;
  90.     #[ORM\OneToMany(targetEntityProduct::class, mappedBy'company'orphanRemovaltrue)]
  91.     #[Groups(['company''category'])]
  92.     protected $products;
  93.     #[ORM\ManyToMany(targetEntityCategory::class, inversedBy'companies')]
  94.     #[Groups(['company''category'])]
  95.     protected Collection $categories;
  96.     #[ORM\OneToMany(targetEntity'App\Entity\CompanyFav'mappedBy'company'orphanRemovaltruecascade: ['remove'])]
  97.     protected Collection $companyFavCompanies;
  98.     #[OneToOne(targetEntityAdapterContent::class, inversedBy'product')]
  99.     #[JoinColumn(name'adapterContent_id'referencedColumnName'id')]
  100.     protected AdapterContent|null $adapterContent null;
  101.     public function __construct()
  102.     {
  103.         parent::__construct();
  104.         $this->products = new ArrayCollection();
  105.         $this->categories = new ArrayCollection();
  106.         $this->companyFavCompanies = new ArrayCollection();
  107.     }
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     public function getName(): ?string
  113.     {
  114.         return $this->name;
  115.     }
  116.     public function setName(string $name): self
  117.     {
  118.         $this->name $name;
  119.         return $this;
  120.     }
  121.     public function getImage(): ?string
  122.     {
  123.         return $this->image;
  124.     }
  125.     public function setImage(?string $image): self
  126.     {
  127.         $this->image $image;
  128.         return $this;
  129.     }
  130.     public function getStartingdate(): ?\DateTimeInterface
  131.     {
  132.         return $this->startingdate;
  133.     }
  134.     public function setStartingdate(?\DateTimeInterface $startingdate): self
  135.     {
  136.         $this->startingdate $startingdate;
  137.         return $this;
  138.     }
  139.     public function getProducts(): Collection
  140.     {
  141.         return $this->products;
  142.     }
  143.     public function addProduct(Product $product): self
  144.     {
  145.         if (!$this->products->contains($product)) {
  146.             $this->products->add($product);
  147.             $product->setCompany($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeProduct(Product $product): self
  152.     {
  153.         if ($this->products->removeElement($product)) {
  154.             if ($product->getCompany() === $this) {
  155.                 $product->setCompany(null);
  156.             }
  157.         }
  158.         return $this;
  159.     }
  160.     public function getCategories(): Collection
  161.     {
  162.         return $this->categories;
  163.     }
  164.     public function addCategory(Category $category): self
  165.     {
  166.         if (!$this->categories->contains($category)) {
  167.             $this->categories->add($category);
  168.         }
  169.         return $this;
  170.     }
  171.     public function removeCategory(Category $category): self
  172.     {
  173.         $this->categories->removeElement($category);
  174.         return $this;
  175.     }
  176.     public function getCompanyFavCompanies(): Collection
  177.     {
  178.         return $this->companyFavCompanies;
  179.     }
  180.     public function addCompanyFavCompany($compfav): self
  181.     {
  182.         if (!$this->companyFavCompanies->contains($compfav)) {
  183.             $this->companyFavCompanies->add($compfav);
  184.             $compfav->setCompany($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removeCompanyFavCompany($compfav): self
  189.     {
  190.         if ($this->companyFavCompanies->removeElement($compfav)) {
  191.             if ($compfav->getCompany() === $this) {
  192.                 $compfav->setCompany(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     public function getCertification(): ?string
  198.     {
  199.         return $this->certification;
  200.     }
  201.     public function setCertification(?string $certification): self
  202.     {
  203.         $this->certification $certification;
  204.         return $this;
  205.     }
  206.     public function getNiveau(): ?string
  207.     {
  208.         return $this->niveau;
  209.     }
  210.     public function setNiveau(string $niveau): self
  211.     {
  212.         $this->niveau $niveau;
  213.         return $this;
  214.     }
  215.     public function getSlug(): ?string
  216.     {
  217.         return $this->slug;
  218.     }
  219.     public function setSlug(string $slug): self
  220.     {
  221.         $this->slug $slug;
  222.         return $this;
  223.     }
  224.     public function getDescription(): ?string
  225.     {
  226.         return $this->description;
  227.     }
  228.     public function setDescription(string $description): self
  229.     {
  230.         $this->description $description;
  231.         return $this;
  232.     }
  233.     public function getVision(): ?string
  234.     {
  235.         return $this->vision;
  236.     }
  237.     public function setVision(string $vision): self
  238.     {
  239.         $this->vision $vision;
  240.         return $this;
  241.     }
  242.     public function getSocialreason(): ?string
  243.     {
  244.         return $this->socialreason;
  245.     }
  246.     public function setSocialreason(string $socialreason): self
  247.     {
  248.         $this->socialreason $socialreason;
  249.         return $this;
  250.     }
  251.     public function getInfluencezone(): ?string
  252.     {
  253.         return $this->influencezone;
  254.     }
  255.     public function setInfluencezone(string $influencezone): self
  256.     {
  257.         $this->influencezone $influencezone;
  258.         return $this;
  259.     }
  260.     public function getWantevaluation(): ?bool
  261.     {
  262.         return $this->wantevaluation;
  263.     }
  264.     public function setWantevaluation(bool $wantevaluation): self
  265.     {
  266.         $this->wantevaluation $wantevaluation;
  267.         return $this;
  268.     }
  269.     public function getLatitude(): ?float
  270.     {
  271.         return $this->latitude;
  272.     }
  273.     public function setLatitude(float $latitude): self
  274.     {
  275.         $this->latitude $latitude;
  276.         return $this;
  277.     }
  278.     public function getLongtitude(): ?float
  279.     {
  280.         return $this->longtitude;
  281.     }
  282.     public function setLongtitude(float $longtitude): self
  283.     {
  284.         $this->longtitude $longtitude;
  285.         return $this;
  286.     }
  287.     public function getStreet(): ?string
  288.     {
  289.         return $this->street;
  290.     }
  291.     public function setStreet(string $street): self
  292.     {
  293.         $this->street $street;
  294.         return $this;
  295.     }
  296.     public function getStreetnumber(): ?string
  297.     {
  298.         return $this->streetnumber;
  299.     }
  300.     public function setStreetnumber(?string $streetnumber): self
  301.     {
  302.         $this->streetnumber $streetnumber;
  303.         return $this;
  304.     }
  305.     public function getPostcode(): ?string
  306.     {
  307.         return $this->postcode;
  308.     }
  309.     public function setPostcode(string $postcode): self
  310.     {
  311.         $this->postcode $postcode;
  312.         return $this;
  313.     }
  314.     public function getCity(): ?string
  315.     {
  316.         return $this->city;
  317.     }
  318.     public function setCity(string $city): self
  319.     {
  320.         $this->city $city;
  321.         return $this;
  322.     }
  323.     public function getRegion(): ?string
  324.     {
  325.         return $this->region;
  326.     }
  327.     public function setRegion(string $region): self
  328.     {
  329.         $this->region $region;
  330.         return $this;
  331.     }
  332.     public function getCountry(): ?string
  333.     {
  334.         return $this->country;
  335.     }
  336.     public function setCountry(string $country): self
  337.     {
  338.         $this->country $country;
  339.         return $this;
  340.     }
  341.     public function getPhone(): ?string
  342.     {
  343.         return $this->phone;
  344.     }
  345.     public function setPhone(string $phone): self
  346.     {
  347.         $this->phone $phone;
  348.         return $this;
  349.     }
  350.     public function getUrlwebsite(): ?string
  351.     {
  352.         return $this->urlwebsite;
  353.     }
  354.     public function setUrlwebsite(?string $urlwebsite): self
  355.     {
  356.         $this->urlwebsite $urlwebsite;
  357.         return $this;
  358.     }
  359.     public function getUrlfacebook(): ?string
  360.     {
  361.         return $this->urlfacebook;
  362.     }
  363.     public function setUrlfacebook(?string $urlfacebook): self
  364.     {
  365.         $this->urlfacebook $urlfacebook;
  366.         return $this;
  367.     }
  368.     public function getUrltwitter(): ?string
  369.     {
  370.         return $this->urltwitter;
  371.     }
  372.     public function setUrltwitter(?string $urltwitter): self
  373.     {
  374.         $this->urltwitter $urltwitter;
  375.         return $this;
  376.     }
  377.     public function getUrllinkedin(): ?string
  378.     {
  379.         return $this->urllinkedin;
  380.     }
  381.     public function setUrllinkedin(?string $urllinkedin): self
  382.     {
  383.         $this->urllinkedin $urllinkedin;
  384.         return $this;
  385.     }
  386.     public function getPackage(): ?int
  387.     {
  388.         return $this->package;
  389.     }
  390.     public function setPackage(?int $package): self
  391.     {
  392.         $this->package $package;
  393.         return $this;
  394.     }
  395.     public function getActivated(): ?bool
  396.     {
  397.         return $this->activated;
  398.     }
  399.     public function setActivated(bool $activated): self
  400.     {
  401.         $this->activated $activated;
  402.         return $this;
  403.     }
  404. }