Welcome to the Doctrine ORM Documentation

This documentation provides an overview of the Doctrine ORM project, its features, and how to get started.

Home

Doctrine ORM is an object-relational mapper for PHP 8.1+ that provides transparent persistence for PHP objects. It sits on top of a powerful database abstraction layer (DBAL) and allows developers to work with databases through PHP objects instead of writing SQL queries.

One of its key features is the ability to write database queries in Doctrine Query Language (DQL), an object-oriented SQL dialect inspired by Hibernate's HQL, providing developers with a powerful alternative to traditional SQL.

Visit the Official GitHub Repository for the latest Doctrine ORM code.

Getting Started

Learn how to install and configure Doctrine ORM for your project:

  1. Install via Composer: composer require doctrine/orm
  2. Configure database connection settings
  3. Define your entity classes with annotations or XML/YAML mappings
  4. Generate database schema
  5. Use the EntityManager to perform database operations

For a comprehensive guide, visit the Getting Started Tutorial.

API Reference

Explore the API documentation for detailed information on available methods and classes. Key components include:

  • EntityManager - Core service for managing entities and their persistence
  • QueryBuilder - For constructing DQL queries programmatically
  • Repository - Custom classes for retrieving entities
  • UnitOfWork - Tracks changes to entities and processes updates efficiently

For detailed architecture documentation, check out the Architecture Reference.

Learn about advanced optimization techniques in the Optimizing Entity Management guide.

Resources

Find additional resources, tutorials, and guides to enhance your understanding of Doctrine ORM: