On prod (opcache.preload + prod container), getRepository(Entity::class) returned Doctrine's default repository instead of the custom one when the entity's #[ORM\Entity] had no repositoryClass — so custom finders like DoctorSecretaryRepository::findAllActiveBySecretary threw BadMethodCallException, making /oauth/userinfo return 500 after login. Declare repositoryClass explicitly on all 25 affected entities. Also add app:create-admin command (create/promote a ROLE_ADMIN user by mobile). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Config\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use App\Config\Repository\SiteConfigRepository;
|
|
#[ORM\Entity(repositoryClass: SiteConfigRepository::class)]
|
|
#[ORM\Table(name: 'site_config')]
|
|
class SiteConfig
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\Column(name: 'config_key', type: 'string', length: 100)]
|
|
private string $configKey;
|
|
|
|
#[ORM\Column(name: 'config_value', type: 'text', nullable: true)]
|
|
private ?string $configValue;
|
|
|
|
#[ORM\Column(name: 'updated_at', type: 'integer')]
|
|
private int $updatedAt;
|
|
|
|
public function __construct(string $key, ?string $value = null)
|
|
{
|
|
$this->configKey = $key;
|
|
$this->configValue = $value;
|
|
$this->updatedAt = time();
|
|
}
|
|
|
|
public function getKey(): string { return $this->configKey; }
|
|
public function getValue(): ?string { return $this->configValue; }
|
|
|
|
public function setValue(?string $value): self
|
|
{
|
|
$this->configValue = $value;
|
|
$this->updatedAt = time();
|
|
return $this;
|
|
}
|
|
}
|