<?php
namespace App\Entity\SecurityDocument;
use App\Entity\Documentation\Document as GeneratedDocument;
use App\Repository\SecurityDocument\DocumentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DocumentRepository::class)
* @ORM\Table(name="security_document_document")
*/
class Document
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text")
*/
private $content;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
/**
* @ORM\OneToMany(targetEntity=GeneratedDocument::class, mappedBy="securityDocument")
*/
private $generatedDocuments;
public function __construct()
{
$this->generatedDocuments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
/**
* @return Collection<int, GeneratedDocument>
*/
public function getGeneratedDocuments(): Collection
{
return $this->generatedDocuments;
}
public function addGeneratedDocument(GeneratedDocument $generatedDocument): self
{
if (!$this->generatedDocuments->contains($generatedDocument)) {
$this->generatedDocuments[] = $generatedDocument;
$generatedDocument->setSecurityDocument($this);
}
return $this;
}
public function removeGeneratedDocument(GeneratedDocument $generatedDocument): self
{
if ($this->generatedDocuments->removeElement($generatedDocument)) {
// set the owning side to null (unless already changed)
if ($generatedDocument->getSecurityDocument() === $this) {
$generatedDocument->setSecurityDocument(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
}