src/Entity/Colleague.php line 19

  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Uid\Ulid;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\ColleagueRepository;
  6. use ApiPlatform\Core\Annotation\ApiResource;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. #[ORM\Entity(repositoryClassColleagueRepository::class)]
  11. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalsehardDeletetrue)]
  12. #[ORM\HasLifecycleCallbacks()]
  13. #[ApiResource(
  14.     attributes: ["security" => "is_granted('IS_AUTHENTICATED_FULLY')"],
  15. )]
  16. class Colleague
  17. {
  18.     use Timestamps;
  19.     #[ORM\Id]
  20.     #[ORM\Column(type'ulid'uniquetrue)]
  21.     #[ORM\GeneratedValue(strategy"CUSTOM")]
  22.     #[ORM\CustomIdGenerator(class: UlidGenerator::class)]
  23.     #[Groups(['read:colleague:basic'])]
  24.     private ?Ulid $id null;
  25.     #[ORM\Column(type'string'length255)]
  26.     #[Groups(['read:colleague:basic'])]
  27.     private $first_name;
  28.     #[Groups(['read:colleague:basic'])]
  29.     #[ORM\Column(type'string'length255)]
  30.     private $last_name;
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     #[Groups(['read:colleague:basic'])]
  33.     private $email;
  34.     #[ORM\Column(type'string'length255nullabletrue)]
  35.     #[Groups(['read:colleague:basic'])]
  36.     private $phone;
  37.     #[ORM\Column(type'string'length255nullabletrue)]
  38.     #[Groups(['read:colleague:basic'])]
  39.     private $mobile;
  40.     #[ORM\Column(type'string'length255nullabletrue)]
  41.     #[Groups(['read:colleague:basic'])]
  42.     private $job;
  43.     #[ORM\ManyToOne(targetEntityCompany::class, inversedBy'colleagues')]
  44.     #[ORM\JoinColumn(nullablefalse)]
  45.     private $owner;
  46.     #[ORM\Column(type'string'length255nullabletrue)]
  47.     private $photo;
  48.     #[ORM\Column(type'string'length255nullabletrue)]
  49.     private $website;
  50.     #[ORM\Column(type'string'length255nullabletrue)]
  51.     private $facebook;
  52.     #[ORM\Column(type'string'length255nullabletrue)]
  53.     private $twitter;
  54.     #[ORM\Column(type'string'length255nullabletrue)]
  55.     private $instagram;
  56.     #[ORM\Column(type'string'length255nullabletrue)]
  57.     private $youtube;
  58.     #[ORM\Column(type'string'length255nullabletrue)]
  59.     private $tiktok;
  60.     public function getId(): ?Ulid
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function __toString()
  65.     {
  66.         return $this->first_name " " $this->last_name;
  67.         ;
  68.     }
  69.     public function getFirstName(): ?string
  70.     {
  71.         return $this->first_name;
  72.     }
  73.     public function setFirstName(string $first_name): self
  74.     {
  75.         $this->first_name $first_name;
  76.         return $this;
  77.     }
  78.     public function getLastName(): ?string
  79.     {
  80.         return $this->last_name;
  81.     }
  82.     public function setLastName(string $last_name): self
  83.     {
  84.         $this->last_name $last_name;
  85.         return $this;
  86.     }
  87.     public function getEmail(): ?string
  88.     {
  89.         return $this->email;
  90.     }
  91.     public function setEmail(?string $email): self
  92.     {
  93.         $this->email $email;
  94.         return $this;
  95.     }
  96.     public function getPhone(): ?string
  97.     {
  98.         return $this->phone;
  99.     }
  100.     public function setPhone(?string $phone): self
  101.     {
  102.         $this->phone $phone;
  103.         return $this;
  104.     }
  105.     public function getMobile(): ?string
  106.     {
  107.         return $this->mobile;
  108.     }
  109.     public function setMobile(?string $mobile): self
  110.     {
  111.         $this->mobile $mobile;
  112.         return $this;
  113.     }
  114.     public function getJob(): ?string
  115.     {
  116.         return $this->job;
  117.     }
  118.     public function setJob(?string $job): self
  119.     {
  120.         $this->job $job;
  121.         return $this;
  122.     }
  123.     public function getOwner(): ?Company
  124.     {
  125.         return $this->owner;
  126.     }
  127.     public function setOwner(?Company $owner): self
  128.     {
  129.         $this->owner $owner;
  130.         return $this;
  131.     }
  132.     public function getPhoto(): ?string
  133.     {
  134.         return $this->photo;
  135.     }
  136.     public function setPhoto(?string $photo): self
  137.     {
  138.         $this->photo $photo;
  139.         return $this;
  140.     }
  141.     public function getWebsite(): ?string
  142.     {
  143.         return $this->website;
  144.     }
  145.     public function setWebsite(?string $website): self
  146.     {
  147.         $this->website $website;
  148.         return $this;
  149.     }
  150.     public function getFacebook(): ?string
  151.     {
  152.         return $this->facebook;
  153.     }
  154.     public function setFacebook(?string $facebook): self
  155.     {
  156.         $this->facebook $facebook;
  157.         return $this;
  158.     }
  159.     public function getTwitter(): ?string
  160.     {
  161.         return $this->twitter;
  162.     }
  163.     public function setTwitter(?string $twitter): self
  164.     {
  165.         $this->twitter $twitter;
  166.         return $this;
  167.     }
  168.     public function getInstagram(): ?string
  169.     {
  170.         return $this->instagram;
  171.     }
  172.     public function setInstagram(?string $instagram): self
  173.     {
  174.         $this->instagram $instagram;
  175.         return $this;
  176.     }
  177.     public function getYoutube(): ?string
  178.     {
  179.         return $this->youtube;
  180.     }
  181.     public function setYoutube(?string $youtube): self
  182.     {
  183.         $this->youtube $youtube;
  184.         return $this;
  185.     }
  186.     public function getTiktok(): ?string
  187.     {
  188.         return $this->tiktok;
  189.     }
  190.     public function setTiktok(?string $tiktok): self
  191.     {
  192.         $this->tiktok $tiktok;
  193.         return $this;
  194.     }
  195. }