src/Entity/Document/BlockCategory.php line 12
<?phpnamespace App\Entity\Document;use App\Entity\User;use App\Repository\Document\BlockCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: BlockCategoryRepository::class)]class BlockCategory{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\ManyToOne(inversedBy: 'blockCategories')]private ?User $owner = null;#[ORM\OneToMany(mappedBy: 'category', targetEntity: Block::class)]private Collection $blocks;public function __construct(){$this->blocks = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): static{$this->title = $title;return $this;}public function getOwner(): ?User{return $this->owner;}public function setOwner(?User $owner): static{$this->owner = $owner;return $this;}/*** @return Collection<int, Block>*/public function getBlocks(): Collection{return $this->blocks;}public function addBlock(Block $block): static{if (!$this->blocks->contains($block)) {$this->blocks->add($block);$block->setCategory($this);}return $this;}public function removeBlock(Block $block): static{if ($this->blocks->removeElement($block)) {// set the owning side to null (unless already changed)if ($block->getCategory() === $this) {$block->setCategory(null);}}return $this;}}