download
raw
1.62 kB
<?php
namespace App\Entity;
use App\Repository\EditorRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EditorRepository::class)]
class Editor
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
/**
* @var Collection<int, Book>
*/
#[ORM\OneToMany(targetEntity: Book::class, mappedBy: 'editor', orphanRemoval: true)]
private Collection $books;
public function __construct()
{
$this->books = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Book>
*/
public function getBooks(): Collection
{
return $this->books;
}
public function addBook(Book $book): static
{
if (!$this->books->contains($book)) {
$this->books->add($book);
$book->setEditor($this);
}
return $this;
}
public function removeBook(Book $book): static
{
if ($this->books->removeElement($book)) {
// set the owning side to null (unless already changed)
if ($book->getEditor() === $this) {
$book->setEditor(null);
}
}
return $this;
}
}

Xet Storage Details

Size:
1.62 kB
·
Xet hash:
c6a5aa4b46d9f72770baf6922487a11e35237d71f217dffc54b6f1e7951e9fa6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.