<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use App\Repository\TokenCrmRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\SerializedName;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=TokenCrmRepository::class)
*/
class TokenCrm
{
/**
* Hook timestampable behavior
* updates createdAt, updatedAt fields
*/
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
* @SerializedName("id")
* @ApiProperty(identifier=true)
* @Assert\Uuid()
*/
private string $id;
/**
* @ORM\Column(type="string", length=2048)
* @SerializedName("bearer_token")
*/
private string $bearerToken;
/**
* @ORM\Column(type="integer")
* @SerializedName("expires_in")
*/
private int $expiresIn;
/**
* @return string
*/
public function getId(): ?string
{
return $this->id;
}
public function getBearerToken(): string
{
return $this->bearerToken;
}
public function setBearerToken(string $bearerToken): self
{
$this->bearerToken = $bearerToken;
return $this;
}
public function getExpiresIn(): int
{
return $this->expiresIn;
}
public function setExpiresIn(int $expiresIn): self
{
$this->expiresIn = $expiresIn;
return $this;
}
/**
* @SerializedName("created_at")
*/
public function getCreatedAtTimestampable(): ?\DateTimeInterface
{
return $this->createdAt;
}
}