janus/src/Entity/APIKey.php

60 lines
1022 B
PHP

<?php
namespace App\Entity;
use App\Repository\APIKeyRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=APIKeyRepository::class)
*/
class APIKey
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $token;
/**
* @ORM\ManyToOne(targetEntity=Consumer::class, inversedBy="apiKeys")
* @ORM\JoinColumn(nullable=false)
*/
private $consumer;
public function getId(): ?int
{
return $this->id;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(string $token): self
{
$this->token = $token;
return $this;
}
public function getConsumer(): ?Consumer
{
return $this->consumer;
}
public function setConsumer(?Consumer $consumer): self
{
$this->consumer = $consumer;
return $this;
}
}