Define your application data as PHP classes and let Doctrine automatically read and write them to a MySQL or PostgreSQL database.
Write complex database queries using Doctrine's DQL language instead of raw SQL, working with objects and relationships instead of table rows.
Build a Symfony-based web application that needs to store, retrieve, and relate structured data in a relational database.
Migrate a PHP project from raw SQL queries to an ORM to reduce repetitive boilerplate and centralize data access logic.
Requires an existing PHP project with Composer and a relational database such as MySQL or PostgreSQL.
Doctrine ORM is a library for PHP applications that handles the connection between code objects and a relational database. It is called an object-relational mapper because it maps the data stored in database tables onto PHP objects, letting developers work with data as normal objects in code instead of writing raw SQL queries. The core idea is that a developer defines their data structures as PHP classes, and Doctrine handles reading those objects from the database and writing them back when changes are made. This is called transparent persistence: the developer works with regular PHP objects, and the library takes care of synchronizing them with the database behind the scenes. For cases where developers need more control over database queries, Doctrine provides its own query language called DQL (Doctrine Query Language). DQL looks similar to SQL but operates on objects and their relationships rather than on raw table rows and columns. This makes complex queries easier to write when your data model is organized around objects. Doctrine ORM sits on top of a separate database abstraction layer called DBAL, which handles the actual communication with the database engine. This separation means the ORM itself does not need to know the details of which database is being used. The repository shown here is for the upcoming Doctrine 3.0, which contains significant changes from earlier versions. The stable releases at the time of the README were the 2.7 and 2.8 branches. Doctrine ORM is a widely used library in the PHP ecosystem, particularly in projects built with the Symfony framework, though it works independently as well.
← doctrine on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.