src/Entity/Company.php line 114

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Controller\Api\Collaborator\DeleteCollaboratorsFromCompany;
  5. use App\Controller\Api\Collaborator\GetCollaboratorsFromCompanyController;
  6. use App\Controller\Api\Company\AddCollaboratorController;
  7. use App\Controller\Api\Company\AddCompanyRequestController;
  8. use App\Controller\Api\Company\AddCompanyWithClaimingRequestController;
  9. use App\Controller\Api\Company\AddManagerFromCompanyController;
  10. use App\Controller\Api\Company\GetCompanyByCodeController;
  11. use App\Controller\Api\Company\GetDealsFromCompanyController;
  12. use App\Controller\Api\Company\GetNearestCompaniesController;
  13. use App\Controller\Api\Company\PutCompaniesController;
  14. use App\Controller\Api\Company\UpdateActivityController;
  15. use App\Controller\Api\Company\UpdateAddressController;
  16. use App\Repository\CompanyRepository;
  17. use Doctrine\Common\Collections\ArrayCollection;
  18. use Doctrine\Common\Collections\Collection;
  19. use Doctrine\DBAL\Types\Types;
  20. use Doctrine\ORM\Mapping as ORM;
  21. use Gedmo\Timestampable\Traits\TimestampableEntity;
  22. use Symfony\Component\Serializer\Annotation\Groups;
  23. #[ORM\Entity(repositoryClassCompanyRepository::class)]
  24. #[ApiResource(
  25.     collectionOperations: [
  26.         'get_nearest_companies' => [
  27.             'normalization_context' => [
  28.                 'groups' => 'read:company:collection:getNearestCompanies',
  29.             ],
  30.             'controller' => GetNearestCompaniesController::class,
  31.             'method' => 'POST',
  32.             'path' => '/public/nearest-companies',
  33.             'read' => false,
  34.         ],
  35.         'get_company_by_code' => [
  36.             'controller' => GetCompanyByCodeController::class,
  37.             'method' => 'POST',
  38.             'path' => '/companies/get-company-by-code',
  39.         ],
  40.         'add_collaborator' => [
  41.             'controller' => AddCollaboratorController::class,
  42.             'method' => 'POST',
  43.             'path' => '/companies/add-collaborator',
  44.         ],
  45.         'add_company_with_claiming_request' => [
  46.             'controller' => AddCompanyWithClaimingRequestController::class,
  47.             'method' => 'POST',
  48.             'path' => '/companies/add-company-with-claiming-request',
  49.         ],
  50.         'delete_collaborators_from_conpany' => [
  51.             'controller' => DeleteCollaboratorsFromCompany::class,
  52.             'method' => 'DELETE',
  53.             'path' => '/companies/{id}/delete_collaborators',
  54.         ],
  55.     ],
  56.     itemOperations: [
  57.         'get' => [
  58.             'normalization_context' => [
  59.                 'groups' => 'read:company:collection:get',
  60.             ],
  61.             'path' => '/public/companies/{id}',
  62.         ],
  63.         'update_address' => [
  64.             'normalization_context' => [
  65.                 'groups' => 'read:company:collection:get',
  66.             ],
  67.             'method' => "PUT",
  68.             'controller' => UpdateAddressController::class,
  69.             'path' => '/companies/{id}/update-address',
  70.         ],
  71.         'update_activity' => [
  72.             'normalization_context' => [
  73.                 'groups' => 'read:company:collection:get',
  74.             ],
  75.             'method' => "PUT",
  76.             'controller' => UpdateActivityController::class,
  77.             'path' => '/companies/{id}/update-activity',
  78.         ],
  79.         "put" => [
  80.             "method" => "PUT",
  81.             "path" => "/companies/{id}",
  82.             'controller' => PutCompaniesController::class,
  83.             'denormalization_context' => [
  84.                 'groups' => 'write:company:item',
  85.             ],
  86.         ],
  87.         'delete',
  88.         'get_collaborators' => [
  89.             'normalization_context' => [
  90.                 'groups' => 'read:company:collection:getCollaborators',
  91.             ],
  92.             'controller' => GetCollaboratorsFromCompanyController::class,
  93.             'method' => 'POST',
  94.             'path' => '/companies/{id}/collaborators',
  95.         ],
  96.         'post_manager' => [
  97.             'controller' => AddManagerFromCompanyController::class,
  98.             'method' => 'POST',
  99.             'path' => '/companies/{id}/add-manager',
  100.         ],
  101.         'get_deals' => [
  102.             'controller' => GetDealsFromCompanyController::class,
  103.             'method' => 'POST',
  104.             'path' => '/public/companies/{id}/deals',
  105.         ],
  106.     ],
  107.     normalizationContext: [
  108.         'groups' => 'read:company:collection',
  109.     ]
  110. )]
  111. class Company
  112. {
  113.     const STATUS_NEW 'new';
  114.     const STATUS_CLAIMED 'claimed';
  115.     const STATUS_VALIDATED 'validated';
  116.     #[ORM\Id]
  117.     #[ORM\GeneratedValue]
  118.     #[ORM\Column]
  119.     #[Groups([
  120.         'read:club:collection:getCompanies',
  121.         'read:user:item:get',
  122.         'read:user:collection:get',
  123.         'read:club:collection:getUsers',
  124.         'read:user:item:me',
  125.         'read:company:collection:getCollaborators',
  126.         'read:company:collection:get',
  127.         'read:deal:collection:get',
  128.         "read:claimingRequest:collection:getUserCompaniesClaimed",
  129.         'read:user:item:user:companies:management',
  130.     ])]
  131.     private ?int $id null;
  132.     use TimestampableEntity;
  133.     #[ORM\Column(length255)]
  134.     #[Groups([
  135.         'read:club:collection:getCompanies',
  136.         'read:user:item:get',
  137.         'read:user:collection:get',
  138.         'read:club:collection:getUsers',
  139.         'read:user:item:me',
  140.         'read:company:collection:getCollaborators',
  141.         'read:company:collection:get',
  142.         'write:company:item',
  143.         'read:deal:collection:get',
  144.         "read:claimingRequest:collection:getUserCompaniesClaimed",
  145.         'read:user:item:user:companies:management',
  146.         'write:deal:collection:post',
  147.     ])]
  148.     private ?string $name null;
  149.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  150.     #[Groups([
  151.         'read:club:collection:getCompanies',
  152.         'read:company:collection:get',
  153.         'write:company:item',
  154.     ])]
  155.     private ?string $description null;
  156.     #[ORM\Column(length255nullabletrue)]
  157.     #[Groups([
  158.         'read:club:collection:getCompanies',
  159.         'read:company:collection:get',
  160.         'write:company:item',
  161.     ])]
  162.     private ?string $website null;
  163.     #[ORM\OneToMany(mappedBy'company'targetEntityCollaborator::class, cascade: ["persist"])]
  164.     #[Groups([
  165.         'read:club:collection:getCompanies',
  166.         'read:company:collection:get',
  167.     ])]
  168.     private Collection $collaborators;
  169.     #[ORM\OneToMany(mappedBy'company'targetEntityMembership::class, cascade: ["persist"])]
  170.     #[Groups([
  171.         'read:club:collection:getCompanies',
  172.         'read:company:collection:get',
  173.         'read:user:item:me',
  174.     ])]
  175.     private Collection $memberships;
  176.     #[ORM\OneToMany(mappedBy'company'targetEntityPhoto::class, cascade: ["persist"])]
  177.     #[Groups([
  178.         'read:club:collection:getCompanies',
  179.         'read:company:collection:get',
  180.     ])]
  181.     private Collection $photos;
  182.     #[ORM\ManyToOne(cascade: ['persist'], inversedBy'companies')]
  183.     #[ORM\JoinColumn(nullabletrueonDelete"SET NULL")]
  184.     #[Groups([
  185.         'read:club:collection:getCompanies',
  186.         'read:company:collection:get',
  187.         'read:user:item:me',
  188.         'read:user:item:user:companies:management',
  189.     ])]
  190.     private ?Activity $activity null;
  191.     #[ORM\Column(length255nullabletrue)]
  192.     private ?string $idNumber null;
  193.     #[ORM\Column(length255nullabletrue)]
  194.     #[Groups([
  195.         'read:club:collection:getCompanies',
  196.         'read:company:collection:get',
  197.         'write:company:item',
  198.     ])]
  199.     private ?string $contactEmail null;
  200.     #[ORM\Column(length255nullabletrue)]
  201.     #[Groups([
  202.         'read:club:collection:getCompanies',
  203.         'read:company:collection:get',
  204.         'write:company:item',
  205.     ])]
  206.     private ?string $contactPhone null;
  207.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  208.     private ?string $rawAddress null;
  209.     #[ORM\Column(length255nullabletrue)]
  210.     private ?string $rawCity null;
  211.     #[ORM\Column(length255nullabletrue)]
  212.     private ?string $rawManager null;
  213.     #[ORM\Column(length255nullabletrue)]
  214.     private ?string $rawStaff null;
  215.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  216.     private ?string $fti null;
  217.     #[Groups([
  218.         'read:club:collection:getCompanies',
  219.         'read:company:collection:get',
  220.     ])]
  221.     private ?float $distance null;
  222.     #[ORM\Column(length255nullabletrue)]
  223.     private ?string $rawPostalCode null;
  224.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  225.     private ?string $rawLogoUrl null;
  226.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  227.     private ?string $rawDescription null;
  228.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  229.     private ?string $rawTitle null;
  230.     #[ORM\Column(length255nullabletrue)]
  231.     private ?string $rawSitename null;
  232.     #[ORM\Column(length255nullabletrue)]
  233.     private ?string $slug null;
  234.     #[ORM\Column(nullabletrue)]
  235.     private ?int $mauticId null;
  236.     #[ORM\Column]
  237.     #[Groups([
  238.         'read:club:collection:getCompanies',
  239.         'read:company:collection:get',
  240.     ])]
  241.     private ?bool $verified null;
  242.     #[ORM\ManyToOne(inversedBy'companies')]
  243.     #[ORM\JoinColumn(nullabletrueonDelete"SET NULL")]
  244.     #[Groups([
  245.         'read:club:collection:getCompanies',
  246.         'read:company:collection:get',
  247.         'read:user:item:me',
  248.         "read:claimingRequest:collection:getUserCompaniesClaimed",
  249.         'read:user:item:user:companies:management',
  250.     ])]
  251.     private ?Address $address null;
  252.     #[ORM\ManyToMany(targetEntityKeyword::class, inversedBy'companies'cascade: ['persist'])]
  253.     #[Groups([
  254.         'read:club:collection:getCompanies',
  255.         'read:company:collection:get',
  256.         'write:company:item',
  257.     ])]
  258.     private Collection $keywords;
  259.     #[ORM\ManyToOne(inversedBy'companies')]
  260.     #[ORM\JoinColumn(nullabletrueonDelete"SET NULL")]
  261.     #[Groups([
  262.         'read:club:collection:getCompanies',
  263.         'read:company:collection:get',
  264.     ])]
  265.     private ?User $creator null;
  266.     #[ORM\Column(length255nullabletrue)]
  267.     #[Groups([
  268.         'read:club:collection:getCompanies',
  269.         'read:user:item:get',
  270.         'read:user:collection:get',
  271.         'read:club:collection:getUsers',
  272.         'read:user:item:me',
  273.         'read:company:collection:getCollaborators',
  274.         'read:company:collection:get',
  275.         'write:company:item',
  276.         'read:deal:collection:get',
  277.     ])]
  278.     private ?string $status null;
  279.     #[ORM\OneToMany(mappedBy'company'targetEntityClaimingRequest::class)]
  280.     #[Groups([
  281.         'read:club:collection:getCompanies',
  282.         'read:company:collection:get',
  283.         'read:user:item:user:companies:management',
  284.     ])]
  285.     private Collection $claimingRequests;
  286.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  287.     private ?string $webFti null;
  288.     #[ORM\OneToMany(mappedBy'company'targetEntityDeal::class)]
  289.     private Collection $deals;
  290.     #[ORM\Column(length255nullabletrue)]
  291.     #[Groups([
  292.         'read:club:collection:getCompanies',
  293.         'read:company:collection:get',
  294.     ])]
  295.     private ?string $code null;
  296.     #[ORM\Column(nullabletrue)]
  297.     private ?bool $raw404 null;
  298.     #[ORM\Column(nullabletrue)]
  299.     private ?bool $rawAddressKo null;
  300.     #[ORM\Column(nullabletrue)]
  301.     #[Groups([
  302.         'read:club:collection:getCompanies',
  303.         'read:company:collection:get',
  304.         'write:company:item',
  305.     ])]
  306.     private ?bool $visible null;
  307.     public function __construct()
  308.     {
  309.         $this->collaborators = new ArrayCollection();
  310.         $this->memberships = new ArrayCollection();
  311.         $this->photos = new ArrayCollection();
  312.         $this->keywords = new ArrayCollection();
  313.         $this->claimingRequests = new ArrayCollection();
  314.         $this->deals = new ArrayCollection();
  315.         $this->verified false;
  316.         $this->visible true;
  317.     }
  318.     public function __toString(): string
  319.     {
  320.         return $this->name;
  321.     }
  322.     public function getMembershipsCount(): ?int
  323.     {
  324.         return count($this->memberships);
  325.     }
  326.     public static function getStatusList(): array
  327.     {
  328.         return [
  329.             self::STATUS_NEW => 'Nouvelle',
  330.             self::STATUS_CLAIMED => 'Revendiquée',
  331.             self::STATUS_VALIDATED => 'Validée',
  332.         ];
  333.     }
  334.     public function getStatusLabel(): ?string
  335.     {
  336.         $list self::getStatusList();
  337.         return ($this->status != null && array_key_exists($this->status$list) ? $list[$this->status] : null);
  338.     }
  339.     public function getStatusClass(): ?string
  340.     {
  341.         return match ($this->status) {
  342.             self::STATUS_NEW => 'info',
  343.             self::STATUS_CLAIMED => 'primary',
  344.             self::STATUS_VALIDATED => 'success',
  345.             default => null,
  346.         };
  347.     }
  348.     public function getOwner(): ?array
  349.     {
  350.         $owners = [];
  351.         foreach ($this->collaborators as $collaborator) {
  352.             if ($collaborator->isOwner()) {
  353.                 $owners[] = $collaborator->getUser();
  354.             }
  355.         }
  356.         return $owners ?: null;
  357.     }
  358.     #[Groups([
  359.         'read:club:collection:getCompanies',
  360.         'read:company:collection:get',
  361.     ])]
  362.     public function getActiveClub(): ?Club
  363.     {
  364.         foreach ($this->memberships as $membership) {
  365.             if ($membership->getStatus() === Membership::STATUS_ACTIVE) {
  366.                 return $membership->getClub();
  367.             }
  368.         }
  369.         return null;
  370.     }
  371.     #[Groups([
  372.         'read:company:collection:get',
  373.         'read:club:collection:getCompanies',
  374.         'read:company:collection:get',
  375.     ])]
  376.     public function getLogoUrl(): string
  377.     {
  378.         $mainPhoto $this->getMainPhoto();
  379.         if ($mainPhoto) {
  380.             return $mainPhoto->getImageLarge()->getUrl();
  381.         }
  382.         if ($this->rawLogoUrl) {
  383.             return $this->rawLogoUrl;
  384.         }
  385.         return 'https://localbeez.ri7.fr/assets/img/image_placeholder.jpg';
  386.     }
  387.     public function getMainPhoto()
  388.     {
  389.         foreach ($this->photos as $p) {
  390.             if ($p->isMain()) {
  391.                 return $p;
  392.             }
  393.         }
  394.         if (sizeof($this->photos) > 0) {
  395.             return $this->photos[0];
  396.         }
  397.         return false;
  398.     }
  399.     #[Groups([
  400.         'read:company:collection:get',
  401.         'read:club:collection:getCompanies',
  402.         'read:user:item:me',
  403.         'read:user:item:user:companies:management',
  404.         'write:deal:collection:post',
  405.     ])]
  406.     public function getSmallLogoUrl(): string
  407.     {
  408.         $mainPhoto $this->getMainPhoto();
  409.         if ($mainPhoto) {
  410.             return $mainPhoto->getImageMedium()->getUrl();
  411.         }
  412.         if ($this->rawLogoUrl) {
  413.             return $this->rawLogoUrl;
  414.         }
  415.         return 'https://localbeez.ri7.fr/assets/img/image_placeholder.jpg';
  416.     }
  417.     #[Groups([
  418.         'read:company:collection:get',
  419.         'read:club:collection:getCompanies',
  420.         'read:company:collection:get',
  421.         'read:user:item:me',
  422.         'read:deal:collection:get',
  423.         "read:claimingRequest:collection:getUserCompaniesClaimed",
  424.     ])]
  425.     public function getMediumLogoUrl(): string
  426.     {
  427.         $mainPhoto $this->getMainPhoto();
  428.         if ($mainPhoto) {
  429.             return $mainPhoto->getImageMedium()->getUrl();
  430.         }
  431.         if ($this->rawLogoUrl) {
  432.             return $this->rawLogoUrl;
  433.         }
  434.         return 'https://localbeez.ri7.fr/assets/img/image_placeholder.jpg';
  435.     }
  436.     public function getId(): ?int
  437.     {
  438.         return $this->id;
  439.     }
  440.     public function getName(): ?string
  441.     {
  442.         return $this->name;
  443.     }
  444.     public function setName(string $name): self
  445.     {
  446.         $this->name $name;
  447.         return $this;
  448.     }
  449.     public function getDescription(): ?string
  450.     {
  451.         return $this->description;
  452.     }
  453.     public function setDescription(?string $description): self
  454.     {
  455.         $this->description $description;
  456.         return $this;
  457.     }
  458.     public function getWebsite(): ?string
  459.     {
  460.         return $this->website;
  461.     }
  462.     public function setWebsite(?string $website): self
  463.     {
  464.         $this->website $website;
  465.         return $this;
  466.     }
  467.     /**
  468.      * @return Collection<int, Collaborator>
  469.      */
  470.     public function getCollaborators(): Collection
  471.     {
  472.         return $this->collaborators;
  473.     }
  474.     public function addCollaborator(Collaborator $collaborator): self
  475.     {
  476.         if (!$this->collaborators->contains($collaborator)) {
  477.             $this->collaborators->add($collaborator);
  478.             $collaborator->setCompany($this);
  479.         }
  480.         return $this;
  481.     }
  482.     public function removeCollaborator(Collaborator $collaborator): self
  483.     {
  484.         if ($this->collaborators->removeElement($collaborator)) {
  485.             // set the owning side to null (unless already changed)
  486.             if ($collaborator->getCompany() === $this) {
  487.                 $collaborator->setCompany(null);
  488.             }
  489.         }
  490.         return $this;
  491.     }
  492.     /**
  493.      * @return Collection<int, Membership>
  494.      */
  495.     public function getMemberships(): Collection
  496.     {
  497.         return $this->memberships;
  498.     }
  499.     public function addMembership(Membership $membership): self
  500.     {
  501.         if (!$this->memberships->contains($membership)) {
  502.             $this->memberships->add($membership);
  503.             $membership->setCompany($this);
  504.         }
  505.         return $this;
  506.     }
  507.     public function removeMembership(Membership $membership): self
  508.     {
  509.         if ($this->memberships->removeElement($membership)) {
  510.             // set the owning side to null (unless already changed)
  511.             if ($membership->getCompany() === $this) {
  512.                 $membership->setCompany(null);
  513.             }
  514.         }
  515.         return $this;
  516.     }
  517.     /**
  518.      * @return Collection<int, Photo>
  519.      */
  520.     public function getPhotos(): Collection
  521.     {
  522.         return $this->photos;
  523.     }
  524.     public function addPhoto(Photo $photo): self
  525.     {
  526.         if (!$this->photos->contains($photo)) {
  527.             $this->photos->add($photo);
  528.             $photo->setCompany($this);
  529.         }
  530.         return $this;
  531.     }
  532.     public function removePhoto(Photo $photo): self
  533.     {
  534.         if ($this->photos->removeElement($photo)) {
  535.             // set the owning side to null (unless already changed)
  536.             if ($photo->getCompany() === $this) {
  537.                 $photo->setCompany(null);
  538.             }
  539.         }
  540.         return $this;
  541.     }
  542.     public function getActivity(): ?Activity
  543.     {
  544.         return $this->activity;
  545.     }
  546.     public function setActivity(?Activity $activity): self
  547.     {
  548.         $this->activity $activity;
  549.         return $this;
  550.     }
  551.     public function getIdNumber(): ?string
  552.     {
  553.         return $this->idNumber;
  554.     }
  555.     public function setIdNumber(?string $idNumber): self
  556.     {
  557.         $this->idNumber $idNumber;
  558.         return $this;
  559.     }
  560.     public function getContactEmail(): ?string
  561.     {
  562.         return $this->contactEmail;
  563.     }
  564.     public function setContactEmail(?string $contactEmail): self
  565.     {
  566.         $this->contactEmail $contactEmail;
  567.         return $this;
  568.     }
  569.     public function getContactPhone(): ?string
  570.     {
  571.         return $this->contactPhone;
  572.     }
  573.     public function setContactPhone(?string $contactPhone): self
  574.     {
  575.         $this->contactPhone $contactPhone;
  576.         return $this;
  577.     }
  578.     public function getRawAddress(): ?string
  579.     {
  580.         return $this->rawAddress;
  581.     }
  582.     public function setRawAddress(?string $rawAddress): self
  583.     {
  584.         $this->rawAddress $rawAddress;
  585.         return $this;
  586.     }
  587.     public function getRawCity(): ?string
  588.     {
  589.         return $this->rawCity;
  590.     }
  591.     public function setRawCity(?string $rawCity): self
  592.     {
  593.         $this->rawCity $rawCity;
  594.         return $this;
  595.     }
  596.     public function getRawManager(): ?string
  597.     {
  598.         return $this->rawManager;
  599.     }
  600.     public function setRawManager(?string $rawManager): self
  601.     {
  602.         $this->rawManager $rawManager;
  603.         return $this;
  604.     }
  605.     public function getRawStaff(): ?string
  606.     {
  607.         return $this->rawStaff;
  608.     }
  609.     public function setRawStaff(?string $rawStaff): self
  610.     {
  611.         $this->rawStaff $rawStaff;
  612.         return $this;
  613.     }
  614.     public function getFti(): ?string
  615.     {
  616.         return $this->fti;
  617.     }
  618.     public function setFti(?string $fti): self
  619.     {
  620.         $this->fti $fti;
  621.         return $this;
  622.     }
  623.     public function getDistance(): ?float
  624.     {
  625.         return $this->distance;
  626.     }
  627.     public function setDistance(?float $distance): self
  628.     {
  629.         $this->distance $distance;
  630.         return $this;
  631.     }
  632.     public function getRawPostalCode(): ?string
  633.     {
  634.         return $this->rawPostalCode;
  635.     }
  636.     public function setRawPostalCode(?string $rawPostalCode): self
  637.     {
  638.         $this->rawPostalCode $rawPostalCode;
  639.         return $this;
  640.     }
  641.     public function getRawLogoUrl(): ?string
  642.     {
  643.         return $this->rawLogoUrl;
  644.     }
  645.     public function setRawLogoUrl(?string $rawLogoUrl): self
  646.     {
  647.         $this->rawLogoUrl $rawLogoUrl;
  648.         return $this;
  649.     }
  650.     public function getRawDescription(): ?string
  651.     {
  652.         return $this->rawDescription;
  653.     }
  654.     public function setRawDescription(?string $rawDescription): self
  655.     {
  656.         $this->rawDescription $rawDescription;
  657.         return $this;
  658.     }
  659.     public function getRawTitle(): ?string
  660.     {
  661.         return $this->rawTitle;
  662.     }
  663.     public function setRawTitle(?string $rawTitle): self
  664.     {
  665.         $this->rawTitle $rawTitle;
  666.         return $this;
  667.     }
  668.     public function getRawSitename(): ?string
  669.     {
  670.         return $this->rawSitename;
  671.     }
  672.     public function setRawSitename(?string $rawSitename): self
  673.     {
  674.         $this->rawSitename $rawSitename;
  675.         return $this;
  676.     }
  677.     public function getSlug(): ?string
  678.     {
  679.         return $this->slug;
  680.     }
  681.     public function setSlug(?string $slug): self
  682.     {
  683.         $this->slug $slug;
  684.         return $this;
  685.     }
  686.     public function getMauticId(): ?int
  687.     {
  688.         return $this->mauticId;
  689.     }
  690.     public function setMauticId(?int $mauticId): self
  691.     {
  692.         $this->mauticId $mauticId;
  693.         return $this;
  694.     }
  695.     public function isVerified(): ?bool
  696.     {
  697.         return $this->verified;
  698.     }
  699.     public function setVerified(bool $verified): self
  700.     {
  701.         $this->verified $verified;
  702.         return $this;
  703.     }
  704.     public function getAddress(): ?Address
  705.     {
  706.         return $this->address;
  707.     }
  708.     public function setAddress(?Address $address): self
  709.     {
  710.         $this->address $address;
  711.         return $this;
  712.     }
  713.     /**
  714.      * @return Collection|array
  715.      */
  716.     public function getKeywords(): Collection|array
  717.     {
  718.         return $this->keywords->toArray();
  719.     }
  720.     public function addKeyword(Keyword $keyword): self
  721.     {
  722.         if (!$this->keywords->contains($keyword)) {
  723.             $this->keywords->add($keyword);
  724.         }
  725.         return $this;
  726.     }
  727.     public function removeKeyword(Keyword $keyword): self
  728.     {
  729.         $this->keywords->removeElement($keyword);
  730.         return $this;
  731.     }
  732.     public function getCreator(): ?User
  733.     {
  734.         return $this->creator;
  735.     }
  736.     public function setCreator(?User $creator): self
  737.     {
  738.         $this->creator $creator;
  739.         return $this;
  740.     }
  741.     public function getStatus(): ?string
  742.     {
  743.         return $this->status;
  744.     }
  745.     public function setStatus(?string $status): self
  746.     {
  747.         $this->status $status;
  748.         return $this;
  749.     }
  750.     /**
  751.      * @return Collection<int, ClaimingRequest>
  752.      */
  753.     public function getClaimingRequests(): Collection
  754.     {
  755.         return $this->claimingRequests;
  756.     }
  757.     public function addClaimingRequest(ClaimingRequest $claimingRequest): self
  758.     {
  759.         if (!$this->claimingRequests->contains($claimingRequest)) {
  760.             $this->claimingRequests->add($claimingRequest);
  761.             $claimingRequest->setCompany($this);
  762.         }
  763.         return $this;
  764.     }
  765.     public function removeClaimingRequest(ClaimingRequest $claimingRequest): self
  766.     {
  767.         if ($this->claimingRequests->removeElement($claimingRequest)) {
  768.             // set the owning side to null (unless already changed)
  769.             if ($claimingRequest->getCompany() === $this) {
  770.                 $claimingRequest->setCompany(null);
  771.             }
  772.         }
  773.         return $this;
  774.     }
  775.     public function getWebFti(): ?string
  776.     {
  777.         return $this->webFti;
  778.     }
  779.     public function setWebFti(?string $webFti): self
  780.     {
  781.         $this->webFti $webFti;
  782.         return $this;
  783.     }
  784.     /**
  785.      * @return Collection<int, Deal>
  786.      */
  787.     #[Groups([
  788.         'read:company:collection:get',
  789.     ])]
  790.     public function getDeals(): Collection
  791.     {
  792.         return $this->deals;
  793.     }
  794.     public function addDeal(Deal $deal): self
  795.     {
  796.         if (!$this->deals->contains($deal)) {
  797.             $this->deals->add($deal);
  798.             $deal->setCompany($this);
  799.         }
  800.         return $this;
  801.     }
  802.     public function removeDeal(Deal $deal): self
  803.     {
  804.         if ($this->deals->removeElement($deal)) {
  805.             // set the owning side to null (unless already changed)
  806.             if ($deal->getCompany() === $this) {
  807.                 $deal->setCompany(null);
  808.             }
  809.         }
  810.         return $this;
  811.     }
  812.     public function getCode(): ?string
  813.     {
  814.         return $this->code;
  815.     }
  816.     public function setCode(?string $code): self
  817.     {
  818.         $this->code $code;
  819.         return $this;
  820.     }
  821.     public function isRaw404(): ?bool
  822.     {
  823.         return $this->raw404;
  824.     }
  825.     public function setRaw404(?bool $raw404): static
  826.     {
  827.         $this->raw404 $raw404;
  828.         return $this;
  829.     }
  830.     public function isRawAddressKo(): ?bool
  831.     {
  832.         return $this->rawAddressKo;
  833.     }
  834.     public function setRawAddressKo(?bool $rawAddressKo): static
  835.     {
  836.         $this->rawAddressKo $rawAddressKo;
  837.         return $this;
  838.     }
  839.     public function isVisible(): ?bool
  840.     {
  841.         return $this->visible;
  842.     }
  843.     public function setVisible(?bool $visible): static
  844.     {
  845.         $this->visible $visible;
  846.         return $this;
  847.     }
  848. }