WIP: Implement admin CRUD
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Repository\JobProfileRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: JobProfileRepository::class)]
|
||||
class JobProfile implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
@@ -24,6 +25,7 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
private string $uuid;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
|
||||
@@ -111,6 +111,9 @@ class Teamer implements TimestampableEntityInterface
|
||||
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Disposition::class)]
|
||||
private Collection $dispositions;
|
||||
|
||||
#[ORM\OneToOne(mappedBy: 'teamer')]
|
||||
private ?User $user = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->uuid = Uuid::v4();
|
||||
@@ -600,4 +603,16 @@ class Teamer implements TimestampableEntityInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): static
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $lastLoginAt = null;
|
||||
|
||||
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
|
||||
#[ORM\OneToOne(inversedBy: 'user', cascade: ['persist', 'remove'])]
|
||||
private ?Teamer $teamer = null;
|
||||
|
||||
public function __construct()
|
||||
|
||||
Reference in New Issue
Block a user