symfonydoctrine-relations
Define Doctrine entity relationships (OneToMany, ManyToMany, ManyToOne); configure fetch modes, cascade operations, and orphan removal; prevent N+1 queries
When & Why to Use This Skill
This Claude skill streamlines the management of Symfony Doctrine entity relationships, allowing developers to precisely define OneToMany, ManyToMany, and ManyToOne associations. It enhances database performance and data integrity by automating the configuration of fetch modes, cascade operations, and orphan removal, while effectively preventing common N+1 query performance issues.
Use Cases
- Defining complex entity mappings: Quickly set up relational database structures within Symfony using standard Doctrine annotations or attributes for various association types.
- Performance Optimization: Identify and resolve N+1 query problems by configuring optimal fetch modes (EAGER/LAZY) for related entities to reduce database overhead.
- Data Lifecycle Management: Implement robust data handling by configuring cascade persist/remove operations and orphan removal to maintain database consistency and automate cleanup.
| name | symfony:doctrine-relations |
|---|---|
| description | Use when symfony doctrine relations |
symfony:doctrine-relations (Micro)
Use when
- Use when symfony doctrine relations
Rules
- Keep changes minimal and focused
- Ask before running servers/builds/tests
- Load reference/examples only on explicit request
References
reference.mddocs/complexity-tiers.md