Update cascade persistence

This commit is contained in:
2024-12-04 11:27:06 +01:00
parent d4cc1a91a2
commit a95d75d8a5
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ class Project implements UserOwnedInterface, AccountingOwnerInterface
/**
* The User who created this Project.
*/
#[ORM\ManyToOne(inversedBy: 'projects')]
#[ORM\ManyToOne(inversedBy: 'projects', cascade: ['persist'])]
#[ORM\JoinColumn(nullable: false)]
private ?User $owner = null;
+1 -1
View File
@@ -20,7 +20,7 @@ class Reward
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'rewards')]
#[ORM\ManyToOne(inversedBy: 'rewards', cascade: ['persist'])]
#[ORM\JoinColumn(nullable: false)]
private ?Project $project = null;
+1 -1
View File
@@ -134,7 +134,7 @@ class User implements UserInterface, UserOwnedInterface, PasswordAuthenticatedUs
* The projects owned by this User.
*/
#[API\ApiProperty(writable: false)]
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Project::class)]
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Project::class, cascade: ['persist'])]
private Collection $projects;
#[ORM\OneToOne(mappedBy: 'user', cascade: ['persist', 'remove'])]