Add Sheet upload function

This commit is contained in:
2025-04-28 08:01:27 +02:00
parent 9bae324447
commit 49b7c0f5d5
29 changed files with 1106 additions and 135 deletions

View File

@@ -15,6 +15,8 @@ use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: SeasonRepository::class)]
class Season
{
private const string SEASON_CODE_CHARACTERS = 'bcdfghjklmnpqrstvwxz';
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
@@ -148,4 +150,18 @@ class Season
{
return $this->owners->contains($user);
}
public function generateSeasonCode(): self
{
$code = '';
$len = mb_strlen(self::SEASON_CODE_CHARACTERS) - 1;
for ($i = 0; $i < 5; ++$i) {
$code .= self::SEASON_CODE_CHARACTERS[random_int(0, $len)];
}
$this->seasonCode = $code;
return $this;
}
}