<?phpnamespace App\Entity;use App\Repository\ProjectRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProjectRepository::class)]class Project{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 150)] private ?string $name = null; #[ORM\Column(type: Types::TEXT)] private ?string $description = null; #[ORM\OneToMany(mappedBy: 'project', targetEntity: Donation::class)] private Collection $donations; #[ORM\Column(options: ['default' => 1])] private ?bool $active = null; #[ORM\OneToOne(cascade: ['persist', 'remove'])] private ?FileProjectImage $picture = null; public function __construct() { $this->donations = new ArrayCollection(); } public function __toString(): string { return $this->getName(); } 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 getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } /** * @return Collection<int, Donation> */ public function getDonations(): Collection { return $this->donations; } public function addDonation(Donation $donation): self { if (!$this->donations->contains($donation)) { $this->donations->add($donation); $donation->setProject($this); } return $this; } public function removeDonation(Donation $donation): self { if ($this->donations->removeElement($donation)) { // set the owning side to null (unless already changed) if ($donation->getProject() === $this) { $donation->setProject(null); } } return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } public function getPicture(): ?FileProjectImage { return $this->picture; } public function setPicture(?FileProjectImage $picture): self { $this->picture = $picture; return $this; }}