src/Entity/Pointing.php line 21
<?php
namespace App\Entity;
use DateTime;
use App\Entity\Timestamps;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\PointingRepository;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Symfony\Component\Uid\Ulid;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: PointingRepository::class)]
#[Gedmo\SoftDeleteable(fieldName: 'deletedAt', timeAware: false, hardDelete: true)]
#[ORM\HasLifecycleCallbacks]
#[ApiResource(
attributes: ["security" => "is_granted('IS_AUTHENTICATED_FULLY')"],
)]
class Pointing
{
use Timestamps;
#[ORM\Id]
#[ORM\Column(type: 'ulid', unique: true)]
#[ORM\GeneratedValue(strategy: "CUSTOM")]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
#[Groups(['read:pointing:basic'])]
private ?Ulid $id = null;
#[ORM\ManyToOne(targetEntity: Child::class, inversedBy: 'pointings')]
#[ORM\JoinColumn(nullable: false)]
private $child;
#[ORM\Column(type: 'time', nullable: true)]
#[Groups(['read:pointing:basic'])]
private $check_in;
#[ORM\Column(type: 'time', nullable: true)]
#[Groups(['read:pointing:basic'])]
private $check_out;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'pointings')]
#[ORM\JoinColumn(nullable: false)]
private $created_by;
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'pointings')]
#[ORM\JoinColumn(nullable: false)]
private $owner;
#[ORM\ManyToOne(targetEntity: Season::class, inversedBy: 'pointings')]
#[ORM\JoinColumn(nullable: false)]
private $season;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['read:pointing:basic'])]
private $description;
#[ORM\Column(type: 'datetime')]
#[Groups(['read:pointing:basic'])]
private $date;
public function __construct()
{
$this->date = new DateTime();
}
public function getId(): ?Ulid
{
return $this->id;
}
public function getChild(): ?Child
{
return $this->child;
}
public function setChild(?Child $child): self
{
$this->child = $child;
return $this;
}
public function getCheckIn(): ?\DateTimeInterface
{
return $this->check_in;
}
public function setCheckIn(\DateTimeInterface $check_in): self
{
$this->check_in = $check_in;
return $this;
}
public function getCheckOut(): ?\DateTimeInterface
{
return $this->check_out;
}
public function setCheckOut(\DateTimeInterface $check_out): self
{
$this->check_out = $check_out;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->created_by;
}
public function setCreatedBy(?User $created_by): self
{
$this->created_by = $created_by;
return $this;
}
public function getOwner(): ?Company
{
return $this->owner;
}
public function setOwner(?Company $owner): self
{
$this->owner = $owner;
return $this;
}
public function getSeason(): ?Season
{
return $this->season;
}
public function setSeason(?Season $season): self
{
$this->season = $season;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
}