src/Entity/Abonnement.php line 18
<?php
namespace App\Entity;
use Symfony\Component\Uid\Ulid;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\AbonnementRepository;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: AbonnementRepository::class)]
#[Gedmo\SoftDeleteable(fieldName: 'deletedAt', timeAware: false, hardDelete: true)]
#[ORM\HasLifecycleCallbacks]
// #[ApiResource(
// attributes: ["security" => "is_granted('IS_AUTHENTICATED_FULLY')"],
// )]
class Abonnement
{
use Timestamps;
#[ORM\Id]
#[ORM\Column(type: 'ulid', unique: true)]
#[ORM\GeneratedValue(strategy: "CUSTOM")]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private ?Ulid $id = null;
#[ORM\Column(type: 'datetime')]
private $start_date;
#[ORM\Column(type: 'datetime')]
private $expire_date;
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'abonnements')]
#[ORM\JoinColumn(nullable: false)]
private $product;
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'abonnements')]
#[ORM\JoinColumn(nullable: false)]
private $owner;
public function getId(): ?Ulid
{
return $this->id;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->start_date;
}
public function setStartDate(\DateTimeInterface $start_date): self
{
$this->start_date = $start_date;
return $this;
}
public function getExpireDate(): ?\DateTimeInterface
{
return $this->expire_date;
}
public function setExpireDate(\DateTimeInterface $expire_date): self
{
$this->expire_date = $expire_date;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getOwner(): ?Company
{
return $this->owner;
}
public function setOwner(?Company $owner): self
{
$this->owner = $owner;
return $this;
}
}