WIP: Extend and improve profile editing

This commit is contained in:
Björn Fromme
2023-10-01 16:39:32 +02:00
parent 6595fbec8a
commit d776d37cd5
27 changed files with 553 additions and 375 deletions
-28
View File
@@ -46,9 +46,6 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
#[ORM\ManyToOne]
private ?User $owner = null;
#[ORM\ManyToMany(targetEntity: Pickup::class)]
private Collection $pickups;
#[ORM\ManyToMany(targetEntity: Fee::class)]
private Collection $fees;
@@ -64,7 +61,6 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
public function __construct()
{
$this->uuid = Uuid::v4();
$this->pickups = new ArrayCollection();
$this->fees = new ArrayCollection();
$this->applications = new ArrayCollection();
$this->dispositions = new ArrayCollection();
@@ -165,30 +161,6 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
/**
* @return Collection<int, Pickup>
*/
public function getPickups(): Collection
{
return $this->pickups;
}
public function addPickup(Pickup $pickup): static
{
if (!$this->pickups->contains($pickup)) {
$this->pickups->add($pickup);
}
return $this;
}
public function removePickup(Pickup $pickup): static
{
$this->pickups->removeElement($pickup);
return $this;
}
/**
* @return Collection<int, Fee>
*/
-15
View File
@@ -17,9 +17,6 @@ class DispositionRequirement
#[ORM\ManyToOne]
private ?Training $training = null;
#[ORM\ManyToOne]
private ?Pickup $pickup = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $pickupDate = null;
@@ -43,18 +40,6 @@ class DispositionRequirement
return $this;
}
public function getPickup(): ?Pickup
{
return $this->pickup;
}
public function setPickup(?Pickup $pickup): static
{
$this->pickup = $pickup;
return $this;
}
public function getPickupDate(): ?\DateTimeImmutable
{
return $this->pickupDate;
-50
View File
@@ -1,50 +0,0 @@
<?php
namespace App\Entity;
use App\Repository\PickupRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PickupRepository::class)]
class Pickup
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column]
private ?int $busProId = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getBusProId(): ?int
{
return $this->busProId;
}
public function setBusProId(int $busProId): static
{
$this->busProId = $busProId;
return $this;
}
}
+46
View File
@@ -114,6 +114,16 @@ class Teamer implements TimestampableEntityInterface
#[ORM\OneToOne(mappedBy: 'teamer')]
private ?User $user = null;
#[ORM\Column]
private array $pickups = [];
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Bitte gib deine Sprache(n) an', groups: ['profile', 'profile_preflight'])]
private ?string $language = null;
#[ORM\Column(length: 2)]
private ?string $size = null;
public function __construct()
{
$this->uuid = Uuid::v4();
@@ -615,4 +625,40 @@ class Teamer implements TimestampableEntityInterface
return $this;
}
public function getPickups(): array
{
return $this->pickups;
}
public function setPickups(array $pickups): static
{
$this->pickups = $pickups;
return $this;
}
public function getLanguage(): ?string
{
return $this->language;
}
public function setLanguage(?string $language): static
{
$this->language = $language;
return $this;
}
public function getSize(): ?string
{
return $this->size;
}
public function setSize(string $size): static
{
$this->size = $size;
return $this;
}
}