symfonydoctrine-relations

MakFly's avatarfrom MakFly

Define Doctrine entity relationships (OneToMany, ManyToMany, ManyToOne); configure fetch modes, cascade operations, and orphan removal; prevent N+1 queries

⭐26stars🔀4forks📁View on GitHub🕐Updated Dec 30, 2025

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.
namesymfony:doctrine-relations
descriptionUse 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.md
  • docs/complexity-tiers.md