src/Entity/Profile.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use ApiPlatform\Core\Annotation\ApiSubresource;
  5. use App\Controller\Api\ProfileController;
  6. use App\Controller\Api\ProfileImageController;
  7. use App\Repository\ProfileRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\DBAL\Types\Types;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Serializer\Annotation\Groups;
  13. use Symfony\Component\Serializer\Annotation\MaxDepth;
  14. use Symfony\Component\HttpFoundation\File\File;
  15. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. use App\Repository\AnswerRepository;
  18. use Doctrine\Common\Collections\Criteria;
  19. #[ORM\Entity(repositoryClassProfileRepository::class)]
  20. #[ApiResource(
  21.     normalizationContext: ['groups' => ['profile']],
  22.     denormalizationContext: ['groups' => ['profile']],
  23.     
  24.     )]
  25. class Profile
  26. {
  27.     #[ORM\Id]
  28.     #[ORM\GeneratedValue]
  29.     #[ORM\Column(type'integer')]
  30.    #[Groups("profile")]
  31.     private $id;
  32.     #[ORM\Column(type'string'length255nullabletrue)]
  33.     #[Groups(["profile","read_2"])]
  34.    
  35.     private $firstName;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     #[Groups(["profile","read_2"])]
  38.     private $lastName;
  39.     #[ORM\Column(type'string'length255nullabletrue)]
  40.     #[Groups("profile")]
  41.     private $profileImage;
  42.     #[ORM\Column(type'string'length255nullabletrue)]
  43.     private $phoneNumber;
  44.     #[ORM\Column(type'string'nullabletrue)]
  45.     #[Groups("profile")]
  46.     private $gender;
  47.     #[ORM\OneToOne(inversedBy'profile'targetEntityUser::class, cascade: ['persist''remove'])]
  48.     #[Groups(["profile","read_2"])]
  49.     #[Assert\Valid]
  50.     private $user;
  51.     
  52.     #[ORM\ManyToMany(targetEntityLangue::class, inversedBy'profiles')]
  53.     #[Groups("read")]
  54.     private Collection $langues;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     #[Groups("profile")]
  57.     private ?string $profession null;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     #[Groups("profile")]
  60.     private ?string $bio null;
  61.     #[ORM\Column(length255nullabletrue)]
  62.     #[Groups("profile")]
  63.     private ?string $pseudoName null;
  64.     #[ORM\OneToMany(mappedBy'profile'targetEntityGallery::class)]
  65.     private Collection $galleries;
  66.     #[ORM\ManyToMany(targetEntityInterest::class, inversedBy'profiles')]
  67.     #[Groups("read")]
  68.     private Collection $interests;
  69.     #[ORM\Column(length255nullabletrue)]
  70.     #[Groups("profile")]
  71.     private ?string $address null;
  72.     #[ORM\OneToOne(inversedBy'profile'cascade: ['persist''remove'])]
  73.     #[Groups("profile")]
  74.     private ?ProfileTargetSetting $profileTargetSetting null;
  75.     #[ORM\Column(nullabletrue)]
  76.     #[Groups("profile")]
  77.     private ?bool $isVisible true;
  78.     #[ORM\Column(nullabletrue)]
  79.     #[Groups("profile")]
  80.     private ?bool $isDeleted null;
  81.     #[ORM\Column(length255nullabletrue)]
  82.     #[Groups("profile")]
  83.     private ?string $lng null;
  84.     #[ORM\Column(length255nullabletrue)]
  85.     #[Groups("profile")]
  86.     private ?string $lat null;
  87.     #[ORM\Column(length255nullabletrue)]
  88.     #[Groups("profile")]
  89.     private ?string $educationLevel null;
  90.     #[ORM\ManyToMany(targetEntityAnswer::class, inversedBy'profiles')]
  91.     #[Groups("profile")]
  92.     private Collection $answers;
  93.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  94.     #[Groups("profile")]
  95.     private ?\DateTimeInterface $bornAt null;
  96.     #[ORM\Column(nullabletrue)]
  97.     #[Groups("profile")]
  98.     private ?bool $isSmoker true;
  99.     #[ORM\Column(nullabletrue)]
  100.     #[Groups("profile")]
  101.     private ?bool $isDrinker true;
  102.     #[ORM\Column(nullabletrue)]
  103.     #[Groups("profile")]
  104.     private ?bool $hasKids true;
  105.     #[ORM\Column(nullabletrue)]
  106.     #[Groups("profile")]
  107.     private ?bool $isDevorced true;
  108.     #[ORM\OneToMany(mappedBy'profileAskForMatch'targetEntityMatchProfile::class)]
  109.     #[Groups("read")]
  110.     private Collection $askedMatches;
  111.     
  112.  #[Groups("read")]
  113.                                                                                                                                                                             #[ORM\OneToMany(mappedBy'profileMatched'targetEntityMatchProfile::class)]
  114.                                                                                                                                                                             
  115.                                                                                                                                                                             private Collection $matchesByOthers;
  116.     #[ORM\Column(nullabletrue)]
  117.     #[Groups("profile")]
  118.     private ?bool $isNewMatchesByEmail null;
  119.     #[ORM\Column(nullabletrue)]
  120.     #[Groups("profile")]
  121.     private ?bool $isNewMessagesByEmail null;
  122.     #[ORM\Column(nullabletrue)]
  123.     #[Groups("profile")]
  124.     private ?bool $isNewFeedsByEmail null;
  125.     #[ORM\Column(nullabletrue)]
  126.     #[Groups("profile")]
  127.     private ?bool $isNewMatchesByNotif null;
  128.     #[ORM\Column(nullabletrue)]
  129.     #[Groups("profile")]
  130.     private ?bool $isNewMessagesByNotif null;
  131.     #[ORM\Column(length255nullabletrue)]
  132.     #[Groups("profile")]
  133.     private ?string $imageGallery1 null;
  134.     #[ORM\Column(length255nullabletrue)]
  135.     #[Groups("profile")]
  136.     private ?string $imageGallery2 null;
  137.     #[ORM\Column(length255nullabletrue)]
  138.     #[Groups("profile")]
  139.     private ?string $imageGallery3 null;
  140.     #[ORM\Column(length255nullabletrue)]
  141.     #[Groups("profile")]
  142.     private ?string $imageGallery4 null;
  143.     #[ORM\Column(length255nullabletrue)]
  144.     #[Groups("profile")]
  145.     private ?string $imageGallery5 null;
  146.     #[ORM\ManyToMany(targetEntityself::class, inversedBy'likedBy')]
  147.     #[ORM\JoinTable(
  148.         name"profiles_likes"
  149.     )]
  150.     private Collection $likedProfiles;
  151.     #[ORM\ManyToMany(targetEntityself::class, mappedBy'likedProfiles')]
  152.     private Collection $likedBy;
  153.     
  154.     #[ORM\ManyToMany(targetEntityself::class, inversedBy'dislikedBy')]
  155.     #[ORM\JoinTable(
  156.         name"profiles_dislikes"
  157.     )]
  158.     private Collection $dislikedProfiles;
  159.     #[ORM\ManyToMany(targetEntityself::class, mappedBy'dislikedProfiles')]
  160.     private Collection $dislikedBy;
  161.     #[ORM\ManyToMany(targetEntityself::class, inversedBy'matchedByProfiles')]
  162.     private Collection $matchedProfiles;
  163.     #[ORM\ManyToMany(targetEntityself::class, mappedBy'matchedProfiles')]
  164.     private Collection $matchedByProfiles;
  165.     #[ORM\Column(length255nullabletrue)]
  166.     #[Groups("profile")]
  167.     private ?string $verificationProfileImage null;
  168.     #[ORM\OneToMany(mappedBy'profile'targetEntitySuggestion::class)]
  169.     private Collection $suggestions;
  170.     #[ORM\OneToMany(mappedBy'profile'targetEntityTicket::class)]
  171.     private Collection $tickets;
  172.     
  173.     public function __construct()
  174.     {
  175.     
  176.       
  177.         $this->langues = new ArrayCollection();
  178.         // $this->matchs = new ArrayCollection();
  179.         // $this->boosts = new ArrayCollection();
  180.         $this->galleries = new ArrayCollection();
  181.         $this->interests = new ArrayCollection();
  182.         $this->user = new User();
  183.         $this->answers = new ArrayCollection();
  184.         $this->askedMatches = new ArrayCollection();
  185.         $this->matchesByOthers = new ArrayCollection();
  186.         $this->setProfileTargetSetting(new ProfileTargetSetting());
  187.         $this->likedProfiles = new ArrayCollection();
  188.         $this->likedBy = new ArrayCollection();
  189.         $this->dislikedProfiles = new ArrayCollection();
  190.         $this->dislikedBy = new ArrayCollection();
  191.         $this->matchedProfiles = new ArrayCollection();
  192.         $this->matchedByProfiles = new ArrayCollection();
  193.         $this->suggestions = new ArrayCollection();
  194.         $this->tickets = new ArrayCollection();
  195.     }
  196.     
  197.     public function __toString()
  198.     {
  199.         if(!$this->firstName && !$this->lastName){
  200.             return (string)$this->getUser()->getEmail();
  201.         }
  202.         return (string)$this->firstName ." : ".(string)$this->getUser()->getEmail();
  203.     }
  204.     public function getId(): ?int
  205.     {
  206.         return $this->id;
  207.     }
  208.     public function getFirstName(): ?string
  209.     {
  210.         return $this->firstName;
  211.     }
  212.     public function setFirstName(?string $firstName): self
  213.     {
  214.         $this->firstName $firstName;
  215.         return $this;
  216.     }
  217.     public function getLastName(): ?string
  218.     {
  219.         return $this->lastName;
  220.     }
  221.     public function setLastName(?string $lastName): self
  222.     {
  223.         $this->lastName $lastName;
  224.         return $this;
  225.     }
  226.     public function getProfileImage(): ?string
  227.     {
  228.         return $this->profileImage;
  229.     }
  230.     public function setProfileImage(?string $profileImage): self
  231.     {
  232.         $this->profileImage $profileImage;
  233.         return $this;
  234.     }
  235.     public function getPhoneNumber(): ?string
  236.     {
  237.         return $this->phoneNumber;
  238.     }
  239.     public function setPhoneNumber(?string $phoneNumber): self
  240.     {
  241.         $this->phoneNumber $phoneNumber;
  242.         return $this;
  243.     }
  244.     public function getGender(): ?string
  245.     {
  246.         return $this->gender;
  247.     }
  248.     public function setGender(?string $gender): self
  249.     {
  250.         $this->gender $gender;
  251.         return $this;
  252.     }
  253.     public function getUser(): ?User
  254.     {
  255.         return $this->user;
  256.     }
  257.     public function setUser(?User $user): self
  258.     {
  259.         // unset the owning side of the relation if necessary
  260.         if ($user === null && $this->user !== null) {
  261.             $this->user->setProfile(null);
  262.         }
  263.         // set the owning side of the relation if necessary
  264.         if ($user !== null && $user->getProfile() !== $this) {
  265.             $user->setProfile($this);
  266.         }
  267.         $this->user $user;
  268.         return $this;
  269.     }
  270.     /**
  271.      * @return Collection<int, Langue>
  272.      */
  273.     public function getLangues(): Collection
  274.     {
  275.         return $this->langues;
  276.     }
  277.     public function addLangue(Langue $langue): self
  278.     {
  279.         if (!$this->langues->contains($langue)) {
  280.             $this->langues->add($langue);
  281.         }
  282.         return $this;
  283.        
  284.     }
  285.     public function removeLangue(Langue $langue): self
  286.     {
  287.         $this->langues->removeElement($langue);
  288.         return $this;
  289.     }
  290.     public function getProfession(): ?string
  291.     {
  292.         return $this->profession;
  293.     }
  294.     public function setProfession(?string $profession): self
  295.     {
  296.         $this->profession $profession;
  297.         return $this;
  298.     }
  299.     public function getBio(): ?string
  300.     {
  301.         return $this->bio;
  302.     }
  303.     public function setBio(?string $bio): self
  304.     {
  305.         $this->bio $bio;
  306.         return $this;
  307.     }
  308.     public function getPseudoName(): ?string
  309.     {
  310.         return $this->pseudoName;
  311.     }
  312.     public function setPseudoName(?string $pseudoName): self
  313.     {
  314.         $this->pseudoName $pseudoName;
  315.         return $this;
  316.     }
  317.     /**
  318.      * @return Collection<int, Gallery>
  319.      */
  320.     public function getGalleries(): Collection
  321.     {
  322.         return $this->galleries;
  323.     }
  324.     public function addGallery(Gallery $gallery): self
  325.     {
  326.         if (!$this->galleries->contains($gallery)) {
  327.             $this->galleries->add($gallery);
  328.             $gallery->setProfile($this);
  329.         }
  330.         return $this;
  331.     }
  332.     public function removeGallery(Gallery $gallery): self
  333.     {
  334.         if ($this->galleries->removeElement($gallery)) {
  335.             // set the owning side to null (unless already changed)
  336.             if ($gallery->getProfile() === $this) {
  337.                 $gallery->setProfile(null);
  338.             }
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection<int, Interest>
  344.      */
  345.     public function getInterests(): Collection
  346.     {
  347.         return $this->interests;
  348.     }
  349.     public function addInterest(Interest $interest): self
  350.     {
  351.         if (!$this->interests->contains($interest)) {
  352.             $this->interests->add($interest);
  353.         }
  354.         return $this;
  355.     }
  356.     public function removeInterest(Interest $interest): self
  357.     {
  358.         $this->interests->removeElement($interest);
  359.         return $this;
  360.     }
  361.     public function getAddress(): ?string
  362.     {
  363.         return $this->address;
  364.     }
  365.     public function setAddress(string $address): self
  366.     {
  367.         $this->address $address;
  368.         return $this;
  369.     }
  370.     public function getProfileTargetSetting(): ?ProfileTargetSetting
  371.     {
  372.         return $this->profileTargetSetting;
  373.     }
  374.     public function setProfileTargetSetting(?ProfileTargetSetting $profileTargetSetting): self
  375.     {
  376.         // unset the owning side of the relation if necessary
  377.         if ($profileTargetSetting === null && $this->profileTargetSetting !== null) {
  378.             $this->profileTargetSetting->setProfile(null);
  379.         }
  380.         // set the owning side of the relation if necessary
  381.         if ($profileTargetSetting !== null && $profileTargetSetting->getProfile() !== $this) {
  382.             $profileTargetSetting->setProfile($this);
  383.         }
  384.         $this->profileTargetSetting $profileTargetSetting;
  385.         return $this;
  386.     }
  387.     public function isIsVisible(): ?bool
  388.     {
  389.         return $this->isVisible;
  390.     }
  391.     public function setIsVisible(?bool $isVisible): self
  392.     {
  393.         $this->isVisible $isVisible;
  394.         return $this;
  395.     }
  396.     public function isIsDeleted(): ?bool
  397.     {
  398.         return $this->isDeleted;
  399.     }
  400.     public function setIsDeleted(?bool $isDeleted): self
  401.     {
  402.         $this->isDeleted $isDeleted;
  403.         return $this;
  404.     }
  405.     public function getLng(): ?string
  406.     {
  407.         return $this->lng;
  408.     }
  409.     public function setLng(?string $lng): self
  410.     {
  411.         $this->lng $lng;
  412.         return $this;
  413.     }
  414.     public function getLat(): ?string
  415.     {
  416.         return $this->lat;
  417.     }
  418.     public function setLat(?string $lat): self
  419.     {
  420.         $this->lat $lat;
  421.         return $this;
  422.     }
  423.     public function getEducationLevel(): ?string
  424.     {
  425.         return $this->educationLevel;
  426.     }
  427.     public function setEducationLevel(?string $educationLevel): self
  428.     {
  429.         $this->educationLevel $educationLevel;
  430.         return $this;
  431.     }
  432.     /**
  433.      * @return Collection<int, Answer>
  434.      */
  435.     public function getAnswers($type=null): Collection
  436.     {
  437.         
  438.         return $this->answers;
  439.     }
  440.     
  441.     public function getAnswersByType($conditionValue)
  442.     {
  443.         
  444.         $filtredAnswers = [];
  445.         
  446.         foreach($this->answers as $singleAnswer){
  447.             if($singleAnswer->getQuestion()->getType() == $conditionValue){
  448.                 $filtredAnswers[] = $singleAnswer;
  449.             }
  450.         }
  451.         return $filtredAnswers;
  452.         
  453.     }
  454.     public function addAnswer(Answer $answer): self
  455.     {
  456.         if (!$this->answers->contains($answer)) {
  457.             $this->answers->add($answer);
  458.         }
  459.         return $this;
  460.     }
  461.     public function removeAnswer(Answer $answer): self
  462.     {
  463.         $this->answers->removeElement($answer);
  464.         return $this;
  465.     }
  466.     public function getBornAt(): ?\DateTimeInterface
  467.     {
  468.         return $this->bornAt;
  469.     }
  470.     public function setBornAt(?\DateTimeInterface $bornAt): self
  471.     {
  472.         $this->bornAt $bornAt;
  473.         return $this;
  474.     }
  475.     #[Groups("profile")]
  476.     public function getAge()
  477.     {
  478.         $bornAt $this->getBornAt();
  479.         if($this->getBornAt()){
  480.             $dateOfBirth $bornAt->format("Y-m-d");
  481.             $today date("Y-m-d");
  482.             $diff date_diff(date_create($today),date_create($dateOfBirth));
  483.             return (int)$diff->format('%y');
  484.         }
  485.         
  486.         return 0;
  487.         
  488.     }
  489.     public function isIsSmoker(): ?bool
  490.     {
  491.         return $this->isSmoker;
  492.     }
  493.     public function setIsSmoker(?bool $isSmoker): self
  494.     {
  495.         $this->isSmoker $isSmoker;
  496.         return $this;
  497.     }
  498.     public function isIsDrinker(): ?bool
  499.     {
  500.         return $this->isDrinker;
  501.     }
  502.     public function setIsDrinker(?bool $isDrinker): self
  503.     {
  504.         $this->isDrinker $isDrinker;
  505.         return $this;
  506.     }
  507.     public function isHasKids(): ?bool
  508.     {
  509.         return $this->hasKids;
  510.     }
  511.     public function setHasKids(?bool $hasKids): self
  512.     {
  513.         $this->hasKids $hasKids;
  514.         return $this;
  515.     }
  516.     public function isIsDevorced(): ?bool
  517.     {
  518.         return $this->isDevorced;
  519.     }
  520.     public function setIsDevorced(?bool $isDevorced): self
  521.     {
  522.         $this->isDevorced $isDevorced;
  523.         return $this;
  524.     }
  525.     /**
  526.      * @return Collection<int, MatchProfile>
  527.      */
  528.     public function getAskedMatches(): Collection
  529.     {
  530.         return $this->askedMatches;
  531.     }
  532.     public function addAskedMatch(MatchProfile $askedMatch): self
  533.     {
  534.         if (!$this->askedMatches->contains($askedMatch)) {
  535.             $this->askedMatches->add($askedMatch);
  536.             $askedMatch->setProfileAskForMatch($this);
  537.         }
  538.         return $this;
  539.     }
  540.     public function removeAskedMatch(MatchProfile $askedMatch): self
  541.     {
  542.         if ($this->askedMatches->removeElement($askedMatch)) {
  543.             // set the owning side to null (unless already changed)
  544.             if ($askedMatch->getProfileAskForMatch() === $this) {
  545.                 $askedMatch->setProfileAskForMatch(null);
  546.             }
  547.         }
  548.         return $this;
  549.     }
  550.     /**
  551.      * @return Collection<int, MatchProfile>
  552.      */
  553.     public function getMatchesByOthers(): Collection
  554.     {
  555.         return $this->matchesByOthers;
  556.     }
  557.     public function addMatchesByOther(MatchProfile $matchesByOther): self
  558.     {
  559.         if (!$this->matchesByOthers->contains($matchesByOther)) {
  560.             $this->matchesByOthers->add($matchesByOther);
  561.             $matchesByOther->setProfileMatched($this);
  562.         }
  563.         return $this;
  564.     }
  565.     public function removeMatchesByOther(MatchProfile $matchesByOther): self
  566.     {
  567.         if ($this->matchesByOthers->removeElement($matchesByOther)) {
  568.             // set the owning side to null (unless already changed)
  569.             if ($matchesByOther->getProfileMatched() === $this) {
  570.                 $matchesByOther->setProfileMatched(null);
  571.             }
  572.         }
  573.         return $this;
  574.     }
  575.     public function isIsNewMatchesByEmail(): ?bool
  576.     {
  577.         return $this->isNewMatchesByEmail;
  578.     }
  579.     public function setIsNewMatchesByEmail(?bool $isNewMatchesByEmail): self
  580.     {
  581.         $this->isNewMatchesByEmail $isNewMatchesByEmail;
  582.         return $this;
  583.     }
  584.     public function isIsNewMessagesByEmail(): ?bool
  585.     {
  586.         return $this->isNewMessagesByEmail;
  587.     }
  588.     public function setIsNewMessagesByEmail(?bool $isNewMessagesByEmail): self
  589.     {
  590.         $this->isNewMessagesByEmail $isNewMessagesByEmail;
  591.         return $this;
  592.     }
  593.     public function isIsNewFeedsByEmail(): ?bool
  594.     {
  595.         return $this->isNewFeedsByEmail;
  596.     }
  597.     public function setIsNewFeedsByEmail(?bool $isNewFeedsByEmail): self
  598.     {
  599.         $this->isNewFeedsByEmail $isNewFeedsByEmail;
  600.         return $this;
  601.     }
  602.     public function isIsNewMatchesByNotif(): ?bool
  603.     {
  604.         return $this->isNewMatchesByNotif;
  605.     }
  606.     public function setIsNewMatchesByNotif(?bool $isNewMatchesByNotif): self
  607.     {
  608.         $this->isNewMatchesByNotif $isNewMatchesByNotif;
  609.         return $this;
  610.     }
  611.     public function isIsNewMessagesByNotif(): ?bool
  612.     {
  613.         return $this->isNewMessagesByNotif;
  614.     }
  615.     public function setIsNewMessagesByNotif(?bool $isNewMessagesByNotif): self
  616.     {
  617.         $this->isNewMessagesByNotif $isNewMessagesByNotif;
  618.         return $this;
  619.     }
  620.     public function getImageGallery1(): ?string
  621.     {
  622.         return $this->imageGallery1;
  623.     }
  624.     public function setImageGallery1(?string $imageGallery1): self
  625.     {
  626.         $this->imageGallery1 $imageGallery1;
  627.         return $this;
  628.     }
  629.     public function getImageGallery2(): ?string
  630.     {
  631.         return $this->imageGallery2;
  632.     }
  633.     public function setImageGallery2(?string $imageGallery2): self
  634.     {
  635.         $this->imageGallery2 $imageGallery2;
  636.         return $this;
  637.     }
  638.     public function getImageGallery3(): ?string
  639.     {
  640.         return $this->imageGallery3;
  641.     }
  642.     public function setImageGallery3(?string $imageGallery3): self
  643.     {
  644.         $this->imageGallery3 $imageGallery3;
  645.         return $this;
  646.     }
  647.     public function getImageGallery4(): ?string
  648.     {
  649.         return $this->imageGallery4;
  650.     }
  651.     public function setImageGallery4(?string $imageGallery4): self
  652.     {
  653.         $this->imageGallery4 $imageGallery4;
  654.         return $this;
  655.     }
  656.     public function getImageGallery5(): ?string
  657.     {
  658.         return $this->imageGallery5;
  659.     }
  660.     public function setImageGallery5(?string $imageGallery5): self
  661.     {
  662.         $this->imageGallery5 $imageGallery5;
  663.         return $this;
  664.     }
  665. #[Groups("profile")]
  666.     public function getCompletionProfilePercentage(){
  667.         
  668.         $percentage 0;
  669.         
  670.         $value 9.09
  671.         if($this->pseudoName){
  672.             $percentage $percentage +   $value;
  673.         }
  674.         if($this->gender){
  675.             $percentage $percentage +   $value;
  676.         }
  677.         if($this->profileImage){
  678.             $percentage $percentage +   $value;
  679.         }
  680.         if($this->profession){
  681.             $percentage $percentage +   $value;
  682.         }
  683.         if($this->educationLevel){
  684.             $percentage $percentage +   $value;
  685.         }
  686.         if($this->bio){
  687.             $percentage $percentage +   $value;
  688.         }
  689.         if($this->address){
  690.             $percentage $percentage +   $value;
  691.         }
  692.         
  693.         if($this->lng and $this->lat){
  694.             $percentage $percentage +   $value;
  695.         }
  696.         
  697.         if($this->bornAt){
  698.             $percentage $percentage +   $value;
  699.         }
  700.         
  701.         if(count($this->langues) > 0){
  702.             $percentage $percentage +   $value;
  703.         }
  704.         if(count($this->interests) > 0){
  705.             $percentage $percentage +   $value;
  706.         }
  707.         
  708.         return round($percentage0PHP_ROUND_HALF_UP);
  709.     }
  710.  
  711. public function getLikedProfiles()
  712. {
  713.     $filtredData = [];
  714.     
  715.     //return $filtredData;
  716.     
  717.     $gender "male";
  718.     if($this->getGender() == "male"){
  719.         $gender "female";
  720.     }
  721.     foreach($this->likedProfiles as $singleProfile){
  722.         
  723.         
  724.         
  725.         if(
  726.             !in_array($singleProfile,$this->getMatchedProfiles()) and 
  727.             !in_array($singleProfile,$this->getMatchedByProfiles()) and 
  728.             $singleProfile->isIsVisible() and
  729.             $singleProfile->getGender() == $gender 
  730.         ){
  731.             $filtredData[]=$singleProfile;
  732.         }
  733.         
  734.     }
  735.     return $filtredData;
  736. }
  737. public function addLikedProfile(self $likedProfile): self
  738. {
  739.     if (!$this->likedProfiles->contains($likedProfile)) {
  740.         $this->likedProfiles->add($likedProfile);
  741.     }
  742.     return $this;
  743. }
  744. public function removeLikedProfile(self $likedProfile): self
  745. {
  746.     $this->likedProfiles->removeElement($likedProfile);
  747.     return $this;
  748. }
  749. public function getLikedBy()
  750. {
  751.     $filtredData = [];
  752.     
  753.     //return $filtredData;
  754.     
  755.     $gender "male";
  756.     if($this->getGender() == "male"){
  757.         $gender "female";
  758.     }
  759.     foreach($this->likedBy as $singleProfile){
  760.         if(
  761.             !in_array($singleProfile,$this->getMatchedProfiles()) and 
  762.             !in_array($singleProfile,$this->getMatchedByProfiles()) and 
  763.             $singleProfile->isIsVisible() and
  764.             $singleProfile->getGender() == $gender 
  765.         ){
  766.             $filtredData[]=$singleProfile;
  767.         }
  768.         
  769.     }
  770.     return $filtredData;
  771.     //return $this->likedBy;
  772. }
  773. public function addLikedBy(self $likedBy): self
  774. {
  775.     if (!$this->likedBy->contains($likedBy)) {
  776.         $this->likedBy->add($likedBy);
  777.         $likedBy->addLikedProfile($this);
  778.     }
  779.     return $this;
  780. }
  781. public function removeLikedBy(self $likedBy): self
  782. {
  783.     if ($this->likedBy->removeElement($likedBy)) {
  784.         $likedBy->removeLikedProfile($this);
  785.     }
  786.     return $this;
  787. }
  788. public function getDislikedProfiles()
  789. {
  790.     $filtredData = [];
  791.     
  792.     //return $filtredData;
  793.     
  794.     $gender "male";
  795.     if($this->getGender() == "male"){
  796.         $gender "female";
  797.     }
  798.     foreach($this->dislikedProfiles as $singleProfile){
  799.         if(
  800.             !in_array($singleProfile,$this->getMatchedProfiles()) and 
  801.             !in_array($singleProfile,$this->getMatchedByProfiles()) and 
  802.             $singleProfile->isIsVisible() and
  803.             $singleProfile->getGender() == $gender 
  804.         ){
  805.             $filtredData[]=$singleProfile;
  806.         }
  807.         
  808.     }
  809.     return $filtredData;
  810.     //return $this->dislikedProfiles;
  811. }
  812. public function addDislikedProfile(self $dislikedProfile): self
  813. {
  814.     if (!$this->dislikedProfiles->contains($dislikedProfile)) {
  815.         $this->dislikedProfiles->add($dislikedProfile);
  816.     }
  817.     return $this;
  818. }
  819. public function removeDislikedProfile(self $dislikedProfile): self
  820. {
  821.     $this->dislikedProfiles->removeElement($dislikedProfile);
  822.     return $this;
  823. }
  824. public function getDislikedBy()
  825. {
  826.     $filtredData = [];
  827.     //return $filtredData;
  828.     
  829.     $gender "male";
  830.     if($this->getGender() == "male"){
  831.         $gender "female";
  832.     }
  833.     foreach($this->dislikedBy as $singleProfile){
  834.         if(
  835.             !in_array($singleProfile,$this->getMatchedProfiles()) and 
  836.             !in_array($singleProfile,$this->getMatchedByProfiles()) and 
  837.             $singleProfile->isIsVisible()  and
  838.             $singleProfile->getGender() == $gender 
  839.         ){
  840.             $filtredData[]=$singleProfile;
  841.         }
  842.         
  843.     }
  844.     return $filtredData;
  845.     //return $this->dislikedBy;
  846. }
  847. public function addDislikedBy(self $dislikedBy): self
  848. {
  849.     if (!$this->dislikedBy->contains($dislikedBy)) {
  850.         $this->dislikedBy->add($dislikedBy);
  851.         $dislikedBy->addDislikedProfile($this);
  852.     }
  853.     return $this;
  854. }
  855. public function removeDislikedBy(self $dislikedBy): self
  856. {
  857.     if ($this->dislikedBy->removeElement($dislikedBy)) {
  858.         $dislikedBy->removeDislikedProfile($this);
  859.     }
  860.     return $this;
  861. }
  862. public function getMatchedProfiles()
  863. {
  864.     
  865.     
  866.     $filtredData = [];
  867.     
  868.     $gender "male";
  869.     if($this->getGender() == "male"){
  870.         $gender "female";
  871.     }
  872.     
  873.         foreach($this->matchedProfiles as $singleProfile){
  874.         if(
  875.             $singleProfile->getGender() == $gender 
  876.         ){
  877.             $filtredData[]=$singleProfile
  878.         }
  879.         
  880.     }
  881.     return $filtredData;
  882.     
  883.     
  884.     
  885. }
  886. public function addMatchedProfile(self $matchedProfile): self
  887. {
  888.     if (!$this->matchedProfiles->contains($matchedProfile)) {
  889.         $this->matchedProfiles->add($matchedProfile);
  890.     }
  891.     return $this;
  892. }
  893. public function removeMatchedProfile(self $matchedProfile): self
  894. {
  895.     $this->matchedProfiles->removeElement($matchedProfile);
  896.     return $this;
  897. }
  898. public function getMatchedByProfiles()
  899. {
  900.     $filtredData = [];
  901.     
  902.     $gender "male";
  903.     if($this->getGender() == "male"){
  904.         $gender "female";
  905.     }
  906.     
  907.         foreach($this->matchedByProfiles as $singleProfile){
  908.         if(
  909.             $singleProfile->getGender() == $gender 
  910.         ){
  911.             $filtredData[]=$singleProfile
  912.         }
  913.         
  914.     }
  915.     return $filtredData;
  916. }
  917. public function addMatchedByProfile(self $matchedByProfile): self
  918. {
  919.     if (!$this->matchedByProfiles->contains($matchedByProfile)) {
  920.         $this->matchedByProfiles->add($matchedByProfile);
  921.         $matchedByProfile->addMatchedProfile($this);
  922.     }
  923.     return $this;
  924. }
  925. public function removeMatchedByProfile(self $matchedByProfile): self
  926. {
  927.     if ($this->matchedByProfiles->removeElement($matchedByProfile)) {
  928.         $matchedByProfile->removeMatchedProfile($this);
  929.     }
  930.     return $this;
  931. }
  932. public function getVerificationProfileImage(): ?string
  933. {
  934.     return $this->verificationProfileImage;
  935. }
  936. public function setVerificationProfileImage(?string $verificationProfileImage): static
  937. {
  938.     $this->verificationProfileImage $verificationProfileImage;
  939.     return $this;
  940. }
  941. /**
  942.  * @return Collection<int, Suggestion>
  943.  */
  944. public function getSuggestions(): Collection
  945. {
  946.     return $this->suggestions;
  947. }
  948. public function addSuggestion(Suggestion $suggestion): static
  949. {
  950.     if (!$this->suggestions->contains($suggestion)) {
  951.         $this->suggestions->add($suggestion);
  952.         $suggestion->setProfile($this);
  953.     }
  954.     return $this;
  955. }
  956. public function removeSuggestion(Suggestion $suggestion): static
  957. {
  958.     if ($this->suggestions->removeElement($suggestion)) {
  959.         // set the owning side to null (unless already changed)
  960.         if ($suggestion->getProfile() === $this) {
  961.             $suggestion->setProfile(null);
  962.         }
  963.     }
  964.     return $this;
  965. }
  966. /**
  967.  * @return Collection<int, Ticket>
  968.  */
  969. public function getTickets(): Collection
  970. {
  971.     return $this->tickets;
  972. }
  973. public function addTicket(Ticket $ticket): static
  974. {
  975.     if (!$this->tickets->contains($ticket)) {
  976.         $this->tickets->add($ticket);
  977.         $ticket->setProfile($this);
  978.     }
  979.     return $this;
  980. }
  981. public function removeTicket(Ticket $ticket): static
  982. {
  983.     if ($this->tickets->removeElement($ticket)) {
  984.         // set the owning side to null (unless already changed)
  985.         if ($ticket->getProfile() === $this) {
  986.             $ticket->setProfile(null);
  987.         }
  988.     }
  989.     return $this;
  990. }
  991.     
  992.     
  993.    
  994. }