Files
Veranstaltungen/.continue/rules/doctrine-repository-best-practices.md
T
jens 98f4e126fc
PHP Unit Tests / test (push) Has been cancelled
feat(person): initial Person domain with entity, model and DTO
- Add PersonEntity in Data layer with Doctrine ORM attributes
- Add PersonModel in Logic layer for business logic
- Add immutable PersonDto in Shared layer
- Configure doctrine/orm dependency in composer.json
- Add Doctrine deprecation triggers to phpunit configuration
2026-06-08 20:08:01 +02:00

650 B

globs, description
globs description
["**/Data/**/*Repository.php"] Prevents the common error of using invalid Doctrine ORM attributes in Repository classes

When creating Doctrine repositories, NEVER use #[ORM\EntityManager] as this is not a valid Doctrine mapping attribute and causes runtime errors. Repositories must only be instantiated via Dependency Injection with EntityManagerInterface in their constructor. Valid ORM attributes for Repositories include: none (standard), or optionally #[ORM\HasEntityListeners] if needed. Mapping attributes like #[ORM\Entity], #[ORM\Table], #[ORM\JoinColumn] are ONLY for Entity classes, not Repository classes.