doctrine-bootstrap

Configure Doctrine ORM 2.20 EntityManager and entity discovery in OrangeHRM.

1.1k|746|Updated Jan 5, 2017
One-click install
npx skills add https://github.com/orangehrm/orangehrm --skill doctrine-bootstrap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doctrine-bootstrap
Source: https://github.com/orangehrm/orangehrm/tree/main/.agents/skills/doctrine-bootstrap
Command: npx skills add https://github.com/orangehrm/orangehrm --skill doctrine-bootstrap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates common configuration and debugging headaches when working with Doctrine ORM 2.20 in OrangeHRM, such as unmapped entity errors, stale proxy issues, and cache misbehavior when adding new plugins or custom query functions.

Core Features & Use Cases

  • Full Doctrine Bootstrap Documentation: Covers the single EntityManager singleton setup, multi-path entity discovery via ohrm_plugin_paths and PSR-4 autoloading, dev/prod cache split, proxy generation strategies, legacy ENUM column mapping, and custom DQL function registration.
  • Troubleshooting Guidance: Step-by-step fixes for common errors like "Entity has no metadata", class not found issues, and stale proxy misbehavior after deployment.
  • Use Case Example: When adding a new OrangeHRM plugin with custom entity classes, use this Skill to correctly register the entity path, update autoloading, and validate the EntityManager recognizes the new entities without errors.

Quick Start

Consult this skill when adding a new OrangeHRM plugin with entities to correctly register its entity path, update autoloading, and validate the EntityManager recognizes the new entity classes.

Frequently Asked Questions about doctrine-bootstrap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Doctrine ORM entity have no metadata mapping in OrangeHRM?

The "Entity has no metadata" error in Doctrine ORM usually occurs when the entity path is not registered via ohrm_plugin_paths or PSR-4 autoloading is misconfigured. You must correctly register the new plugin entity path so the EntityManager singleton can discover and map the class.

How do I add new plugin entities to the Doctrine EntityManager in OrangeHRM?

To add new plugin entities, register the entity path using ohrm_plugin_paths, update PSR-4 autoloading, and validate that the EntityManager singleton recognizes the new classes. This ensures multi-path entity discovery correctly integrates your custom plugin entities without errors.

How does multi-path entity discovery work with Doctrine ORM 2.20 in OrangeHRM?

Multi-path entity discovery in OrangeHRM uses ohrm_plugin_paths combined with PSR-4 autoloading to allow the single EntityManager singleton to map classes across multiple plugins. This mechanism ensures that custom plugin entities are automatically recognized alongside core system entities.

How do I fix stale proxy issues when deploying Doctrine entity changes to production?

Stale proxy misbehavior after deployment is fixed by configuring the dev/prod cache split and applying correct proxy generation strategies. Regenerating proxies and clearing the production cache ensures the EntityManager uses the updated entity class definitions.

Can I extend Doctrine ORM in OrangeHRM with custom DQL functions?

Yes, you can extend Doctrine ORM in OrangeHRM by registering custom DQL functions. This involves configuring the EntityManager to recognize your custom query functions, allowing you to execute specialized database queries within the ORM framework.

How do I map legacy ENUM columns using Doctrine ORM in OrangeHRM?

Mapping legacy ENUM columns in Doctrine ORM requires specific configuration handling to ensure compatibility. By applying the correct column mapping strategies, the EntityManager can safely interact with legacy database schemas containing ENUM types without query failures.