What problem does it solve?
OrangeHRM uses a strict, custom Doctrine ORM setup with specific conventions for entity mapping, naming, and architecture that deviate from default Doctrine patterns. Defining entities without following these rules causes ORM discovery failures, broken relations, legacy compatibility issues, and inconsistent application behavior. This Skill eliminates guesswork by codifying all project-specific entity requirements and common pitfalls.
Core Features & Use Cases
- Strict Convention Enforcement: Covers flat namespace requirements, docblock annotation-only mapping (no PHP 8 attributes), table naming rules (ohrm_ prefix for new tables, hs_hr_ for legacy 4.x imports), and ID strategy requirements (integer AUTO_INCREMENT only).
- Complete Relation & Lifecycle Guidance: Includes mapping patterns for all relation types (ManyToOne, OneToMany, ManyToMany, OneToOne, self-referential M:N), EntityListener setup for sensitive field encryption, and the project-specific Decorator pattern for entity-adjacent logic with database access.
- Edge Case & Pitfall Coverage: Addresses reserved column name quoting, legacy ENUM handling, NestedSet support for tree-shaped entities like Subunit, and common mistakes (uninitialized collections, wrong mappedBy/inversedBy usage, incorrect referencedColumnName for non-standard IDs like emp_number).
- Use Case: Use this Skill when creating a new entity for an OrangeHRM feature (e.g. a new employee benefits table), adding relations to existing entities, setting up encryption for sensitive fields via EntityListeners, or debugging issues like null fields after load or broken lazy-loading relations.
Quick Start
Follow the entities skill guidelines to define a new Doctrine entity for your OrangeHRM feature with correct table naming, relation mappings, and collection initialization to avoid ORM configuration errors.