<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'report')]
class Report
{
#[ORM\Column(type: 'integer', unique: true)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(name: 'status', type: 'string')]
private $status;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\JoinColumn(name: 'creator', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private $creator;
#[ORM\ManyToOne(targetEntity: ReportType::class, inversedBy: 'reports')]
#[ORM\JoinColumn(nullable: false)]
private $reportType;
#[ORM\Column(type: 'string', length: 255)]
private $message;
#[ORM\Column(type: 'datetime')]
private $createdAt;
#[ORM\Column(type: 'string', length: 50)]
private $entity;
#[ORM\Column(type: 'integer')]
private $entityId;
#[ORM\OneToOne(targetEntity: AdapterContent::class, mappedBy: 'report', cascade: ['persist', 'remove'])]
private $adapterContent;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getCreator()
{
return $this->creator->getId();
}
/**
* @param mixed $creator
*/
public function setCreator($creator)
{
$this->creator = $creator;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status)
{
$this->status = $status;
}
public function getReportType()
{
return $this->reportType->getId();
}
public function setReportType(?ReportType $reportType): self
{
$this->reportType = $reportType;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getEntity(): ?string
{
return $this->entity;
}
public function setEntity(string $entity): self
{
$this->entity = $entity;
return $this;
}
public function getEntityId(): ?int
{
return $this->entityId;
}
public function setEntityId(int $entityId): self
{
$this->entityId = $entityId;
return $this;
}
public function getAdapterContent(): ?AdapterContent
{
return $this->adapterContent;
}
public function setAdapterContent(?AdapterContent $adapterContent): self
{
// unset the owning side of the relation if necessary
if ($adapterContent === null && $this->adapterContent !== null) {
$this->adapterContent->setReport(null);
}
// set the owning side of the relation if necessary
if ($adapterContent !== null && $adapterContent->getReport() !== $this) {
$adapterContent->setReport($this);
}
$this->adapterContent = $adapterContent;
return $this;
}
}