'partial', 'status', 'owner' ])] #[ORM\Entity(repositoryClass: ProjectRepository::class)] class Project { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $title = null; #[API\ApiProperty(writable: false)] #[ORM\OneToOne(cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] private ?Accounting $accounting = null; #[API\ApiProperty(writable: false)] #[ORM\OneToOne(cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] private User $owner; #[API\ApiProperty(writable: true)] #[ORM\Column(type: 'int', enumType: Status::class)] private Status $status; #[Orm\Column()] #[API\ApiProperty(writable: false)] private int $amount; public function __construct() { $this->accounting = new Accounting(); $this->accounting->setOwnerClass(Project::class); } 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 getAccounting(): ?Accounting { return $this->accounting; } public function setAccounting(Accounting $accounting): static { $this->accounting = $accounting; return $this; } public function setOwner(User $owner): static { $this->owner = $owner; return $this; } public function getOwner(): User { return $this->owner; } public function setStatus(string $status): static { $this->status = $status; return $this; } public function getStatus(): string { return $this->status; } public function setAmount(int $amount): static { $this->amount = $amount; return $this; } public function getAmount(): int { return $this->amount; } }