src/Entity/Colleague.php line 19
<?php
namespace App\Entity;
use Symfony\Component\Uid\Ulid;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ColleagueRepository;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: ColleagueRepository::class)]
#[Gedmo\SoftDeleteable(fieldName: 'deletedAt', timeAware: false, hardDelete: true)]
#[ORM\HasLifecycleCallbacks()]
#[ApiResource(
attributes: ["security" => "is_granted('IS_AUTHENTICATED_FULLY')"],
)]
class Colleague
{
use Timestamps;
#[ORM\Id]
#[ORM\Column(type: 'ulid', unique: true)]
#[ORM\GeneratedValue(strategy: "CUSTOM")]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
#[Groups(['read:colleague:basic'])]
private ?Ulid $id = null;
#[ORM\Column(type: 'string', length: 255)]
#[Groups(['read:colleague:basic'])]
private $first_name;
#[Groups(['read:colleague:basic'])]
#[ORM\Column(type: 'string', length: 255)]
private $last_name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['read:colleague:basic'])]
private $email;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['read:colleague:basic'])]
private $phone;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['read:colleague:basic'])]
private $mobile;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['read:colleague:basic'])]
private $job;
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'colleagues')]
#[ORM\JoinColumn(nullable: false)]
private $owner;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $photo;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $website;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $facebook;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $twitter;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $instagram;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $youtube;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $tiktok;
public function getId(): ?Ulid
{
return $this->id;
}
public function __toString()
{
return $this->first_name . " " . $this->last_name;
;
}
public function getFirstName(): ?string
{
return $this->first_name;
}
public function setFirstName(string $first_name): self
{
$this->first_name = $first_name;
return $this;
}
public function getLastName(): ?string
{
return $this->last_name;
}
public function setLastName(string $last_name): self
{
$this->last_name = $last_name;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getMobile(): ?string
{
return $this->mobile;
}
public function setMobile(?string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function getJob(): ?string
{
return $this->job;
}
public function setJob(?string $job): self
{
$this->job = $job;
return $this;
}
public function getOwner(): ?Company
{
return $this->owner;
}
public function setOwner(?Company $owner): self
{
$this->owner = $owner;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getFacebook(): ?string
{
return $this->facebook;
}
public function setFacebook(?string $facebook): self
{
$this->facebook = $facebook;
return $this;
}
public function getTwitter(): ?string
{
return $this->twitter;
}
public function setTwitter(?string $twitter): self
{
$this->twitter = $twitter;
return $this;
}
public function getInstagram(): ?string
{
return $this->instagram;
}
public function setInstagram(?string $instagram): self
{
$this->instagram = $instagram;
return $this;
}
public function getYoutube(): ?string
{
return $this->youtube;
}
public function setYoutube(?string $youtube): self
{
$this->youtube = $youtube;
return $this;
}
public function getTiktok(): ?string
{
return $this->tiktok;
}
public function setTiktok(?string $tiktok): self
{
$this->tiktok = $tiktok;
return $this;
}
}