<?php
namespace Platform\QueueBundle\Entity;
use Cms\CoreBundle\Model\Interfaces\Timestampable\TimestampableInterface;
use Cms\CoreBundle\Model\Interfaces\Timestampable\TimestampableTrait;
use Cms\TenantBundle\Entity\Tenant;
use Doctrine\ORM\Mapping as ORM;
/**
* Class AsyncLog
* @package Platform\QueueBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Platform\QueueBundle\Doctrine\Repository\AsyncLogRepository"
* )
* @ORM\Table(
* name = "sys__queue__async_log",
* )
*/
class AsyncLog implements TimestampableInterface
{
use TimestampableTrait;
/**
* @var int|null
*
* @ORM\Column(
* type = "integer",
* options = {
* "unsigned" = true,
* },
* )
* @ORM\Id
* @ORM\GeneratedValue(
* strategy = "AUTO",
* )
*/
protected ?int $id = null;
/**
* @var Tenant|null
*
* @ORM\ManyToOne(
* targetEntity = "Cms\TenantBundle\Entity\Tenant",
* )
* @ORM\JoinColumn(
* name = "tenant",
* referencedColumnName = "id",
* onDelete = "CASCADE",
* nullable = true,
* )
*/
protected ?Tenant $tenant = null;
/**
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $queueId = null;
/**
* @var array
*
* @ORM\Column(
* type = "json",
* nullable = true,
* )
*/
protected array $queueHeaders = [];
/**
* @var array
*
* @ORM\Column(
* type = "json",
* nullable = true,
* )
*/
protected array $queueBody = [];
/**
* @var string|null
*
* @ORM\Column(
* type = "text",
* nullable = true,
* )
*/
protected ?string $message = null;
/**
* @var array
*
* @ORM\Column(
* type = "json",
* nullable = true,
* )
*/
protected array $error = [];
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
* @return $this
*/
public function setId(?int $id): self
{
$this->id = $id;
return $this;
}
/**
* @return Tenant|null
*/
public function getTenant(): ?Tenant
{
return $this->tenant;
}
/**
* @param Tenant|null $tenant
* @return $this
*/
public function setTenant(?Tenant $tenant): self
{
$this->tenant = $tenant;
return $this;
}
/**
* @return string|null
*/
public function getQueueId(): ?string
{
return $this->queueId;
}
/**
* @param string|null $queueId
* @return $this
*/
public function setQueueId(?string $queueId): self
{
$this->queueId = $queueId;
return $this;
}
/**
* @return array
*/
public function getQueueHeaders(): array
{
return $this->queueHeaders;
}
/**
* @param array $queueHeaders
* @return $this
*/
public function setQueueHeaders(array $queueHeaders): self
{
$this->queueHeaders = $queueHeaders;
return $this;
}
/**
* @return array
*/
public function getQueueBody(): array
{
return $this->queueBody;
}
/**
* @param array $queueBody
* @return $this
*/
public function setQueueBody(array $queueBody): self
{
$this->queueBody = $queueBody;
return $this;
}
/**
* @return string|null
*/
public function getMessage(): ?string
{
return $this->message;
}
/**
* @param string|null $message
* @return $this
*/
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
/**
* @return array
*/
public function getError(): array
{
return $this->error;
}
/**
* @param array $error
* @return $this
*/
public function setError(array $error): self
{
$this->error = $error;
return $this;
}
}