Doctrine ORM Documentation
Guides
Sections
- #[AssociationOverride] - Attributes Reference
- #[AttributeOverride] - Attributes Reference
- #[Cache] - Attributes Reference
- #[ChangeTrackingPolicy] - Attributes Reference
- #[Column] - Attributes Reference
- #[CustomIdGenerator] - Attributes Reference
- #[DiscriminatorColumn] - Attributes Reference
- #[DiscriminatorMap] - Attributes Reference
- #[Embeddable] - Attributes Reference
- #[Embedded] - Attributes Reference
- #[Entity] - Attributes Reference
- #[GeneratedValue] - Attributes Reference
- #[HasLifecycleCallbacks] - Attributes Reference
- #[Id] - Attributes Reference
- #[Index] - Attributes Reference
- #[InheritanceType] - Attributes Reference
- #[JoinColumn], #[InverseJoinColumn] - Attributes Reference
- #[JoinTable] - Attributes Reference
- #[ManyToMany] - Attributes Reference
- #[ManyToOne] - Attributes Reference
- #[MappedSuperclass] - Attributes Reference
- #[OneToMany] - Attributes Reference
- #[OneToOne] - Attributes Reference
- #[OrderBy] - Attributes Reference
- #[PostLoad] - Attributes Reference
- #[PostPersist] - Attributes Reference
- #[PostRemove] - Attributes Reference
- #[PostUpdate] - Attributes Reference
- #[PrePersist] - Attributes Reference
- #[PreRemove] - Attributes Reference
- #[PreUpdate] - Attributes Reference
- #[SequenceGenerator] - Attributes Reference
- #[Table] - Attributes Reference
- #[UniqueConstraint] - Attributes Reference
- #[Version] - Attributes Reference
- A Query fails, how can I debug it? - Frequently Asked Questions
- Adding Bug and User Entities - Getting Started with Doctrine
- Adding a Criteria to a Query - The QueryBuilder
- Adding behavior to Entities - Getting Started with Doctrine
- Adding own commands - Tools
- Adding your own functions to the DQL language - Doctrine Query Language
- Advanced Topics - Welcome to Doctrine ORM's documentation!
- Aggregate Expressions - Doctrine Query Language
- Aggregate Functions - Doctrine Query Language
- Alternative Query Result Formats - Improving Performance
- An Example Model: Bug Tracker - Getting Started with Doctrine
- An example model - Aggregate Fields
- Apply Best Practices - Improving Performance
- Approach 1: Implicitly - Transactions and Concurrency
- Approach 2: Explicitly - Transactions and Concurrency
- Arithmetic Expressions - Doctrine Query Language
- Arithmetic operators - Doctrine Query Language
- Array Hydration of the Bug List - Getting Started with Doctrine
- Association Example Entities - Working with Associations
- Association Management Methods - Working with Associations
- Association Override - Inheritance Mapping
- Association cache definition - The Second Level Cache
- Association proxies - Advanced Configuration
- Associations - Frequently Asked Questions
- Attribute Override - Inheritance Mapping
- Auto-generating Proxy Classes (*OPTIONAL*) - Advanced Configuration
- Autoloading Proxies - Advanced Configuration
- Avoid composite keys - Best Practices
- Background - Keeping your Modules independent
- Behaviors - Limitations and Known Issues
- Bidirectional Associations - Association Updates: Owning Side and Inverse Side
- Binding parameters to your query - The QueryBuilder
- Built-in cached persisters - The Second Level Cache
- Bulk Deletes - Batch Processing
- Bulk Inserts - Batch Processing
- Bulk Updates - Batch Processing
- By Criteria - Working with Objects
- By DQL - Working with Objects
- By Eager Loading - Working with Objects
- By Lazy Loading - Working with Objects
- By Native Queries - Working with Objects
- By Primary Key - Working with Objects
- By Simple Conditions - Working with Objects
- Bytecode Cache - Improving Performance
- Cache API - The Second Level Cache
- Cache Chaining - Caching
- Cache Factory - The Second Level Cache
- Cache Log - The Second Level Cache
- Cache Regions - The Second Level Cache
- Cache Slams - Caching
- Cache mode - The Second Level Cache
- Cache region - The Second Level Cache
- Cache usage - The Second Level Cache
- Caching Regions - The Second Level Cache
- Caching mode - The Second Level Cache
- Can I sort by a function (for example ORDER BY RAND()) in DQL? - Frequently Asked Questions
- Can I use Inheritance with Doctrine ORM? - Frequently Asked Questions
- Cascade Element - XML Mapping
- Case Expressions - Doctrine Query Language
- ChainTypedFieldMapper - Implementing a TypedFieldMapper
- Change Tracking Getters - PHP Mapping
- Change Tracking policies - Improving Performance
- Changelogs - Welcome to Doctrine ORM's documentation!
- Class Table Inheritance - Doctrine Query Language
- Class Table Inheritance - Inheritance Mapping
- Class loading - Installation and Configuration
- ClassMetadata - Metadata Drivers
- ClassMetadata API - PHP Mapping
- ClassMetadataBuilder - PHP Mapping
- ClassMetadataFactory - Doctrine Internals explained
- Clauses - Doctrine Query Language
- Clearing the Cache - Caching
- Collection Expressions - Doctrine Query Language
- Collection, Event Manager and Persistence - Architecture
- Collections - Association Mapping
- Column Prefixing - Separating Concerns using Embeddables
- Command Overview - Tools
- Comments in queries - Doctrine Query Language
- Component - Persisting the Decorator Pattern
- Composite primary key - The Second Level Cache
- Conclusion - Aggregate Fields
- Conclusion - DQL User Defined Functions
- Conclusion - Getting Started with Doctrine
- ConcreteComponent - Persisting the Decorator Pattern
- ConcreteDecorator - Persisting the Decorator Pattern
- Concurrent cache region - The Second Level Cache
- Conditional Expressions - Doctrine Query Language
- Configuration - Filters
- Configuration - The Second Level Cache
- Configuration Options - Advanced Configuration
- Configuring a naming strategy - Implementing a NamingStrategy
- Connection - Advanced Configuration
- Constrain relationships as much as possible - Best Practices
- Constructing a new QueryBuilder object - The QueryBuilder
- Cookbook - Welcome to Doctrine ORM's documentation!
- Core Metadata Drivers - Metadata Drivers
- Creating Classes for the Database - Basic Mapping
- Current Limitations - Limitations and Known Issues
- Custom Persisters - Limitations and Known Issues
- Custom Repositories - Working with Objects
- DELETE / UPDATE queries - The Second Level Cache
- DELETE queries - Doctrine Query Language
- DQL - Separating Concerns using Embeddables
- DQL DELETE - Batch Processing
- DQL Functions - Doctrine Query Language
- DQL Parser - Doctrine Internals explained
- DQL SELECT Examples - Doctrine Query Language
- DQL SELECT clause - Doctrine Query Language
- DQL UPDATE - Batch Processing
- Dashboard of the User - Getting Started with Doctrine
- Database Schema - Frequently Asked Questions
- Database Schema Generation - Tools
- Date Add - DQL User Defined Functions
- Date Diff - DQL User Defined Functions
- DateTime changes are detected by Reference - Working with DateTime Instances
- Decorator - Persisting the Decorator Pattern
- Default Repository (*OPTIONAL*) - Advanced Configuration
- Default Timezone Gotcha - Working with DateTime Instances
- DefaultTypedFieldMapper - Implementing a TypedFieldMapper
- Deferred Explicit - Change Tracking Policies
- Deferred Implicit - Change Tracking Policies
- Defining Fields - XML Mapping
- Defining Identity and Generator Strategies - XML Mapping
- Defining Indexes or Unique Constraints - XML Mapping
- Defining Inheritance Mappings - XML Mapping
- Defining Lifecycle Callbacks - XML Mapping
- Defining Many-To-Many Associations - XML Mapping
- Defining Many-To-One Associations - XML Mapping
- Defining One-To-Many Associations - XML Mapping
- Defining One-To-One Relations - XML Mapping
- Defining Order of To-Many Associations - XML Mapping
- Defining a Mapped Superclass - XML Mapping
- Defining an Entity - XML Mapping
- Derived Entities ID syntax - XML Mapping
- Design-time considerations - Inheritance Mapping
- Detaching entities - Working with Objects
- Development vs Production Configuration - Advanced Configuration
- Direct access to a Unit of Work - Working with Objects
- Disabling/Enabling Filters and Setting Parameters - Filters
- Discriminator Column - Native SQL
- Display Help Information - Tools
- Distributed environments - The Second Level Cache
- Doctrine Console - Tools
- Doctrine Mapping Types - Basic Mapping
- Doctrine ORM Packages - Architecture
- Doctrine Query Language - Frequently Asked Questions
- Doctrine and Caching - Advanced Configuration
- Document syntax: - Doctrine Query Language
- Don't map foreign keys to fields in an entity - Best Practices
- Don't use identifier quoting - Best Practices
- Don't use special characters - Best Practices
- EBNF - Doctrine Query Language
- Effects of Database and UnitOfWork being Out-Of-Sync - Working with Objects
- Enable Second Level Cache - The Second Level Cache
- Enabling Extra-Lazy Associations - Extra Lazy Associations
- Entities - Architecture
- Entities and the Identity Map - Working with Objects
- Entity Classes - Frequently Asked Questions
- Entity Inheritance - Inheritance Mapping
- Entity Object Graph Traversal - Working with Objects
- Entity Repositories - Getting Started with Doctrine
- Entity State - Working with Objects
- Entity cache definition - The Second Level Cache
- Entity listeners - Events
- Entity listeners class - Events
- Entity listeners resolver - Events
- Entity results - Native SQL
- Entity states - Architecture
- EntityGenerator - Frequently Asked Questions
- EntityManager - Doctrine Internals explained
- Establishing Associations - Working with Associations
- Events Overview - Events
- Example - XML Mapping
- Example filter class - Filters
- Example usage - Advanced field value conversion using custom mapping types
- Examples - Native SQL
- Examples - Persisting the Decorator Pattern
- Exception Handling - Transactions and Concurrency
- Executing a Query - The QueryBuilder
- Expr* classes - The QueryBuilder
- Extra-Lazy Collections - Improving Performance
- Fetching Multiple FROM Entities - Doctrine Query Language
- Field & Association Getters - PHP Mapping
- Field Mapping Setters - PHP Mapping
- Field results - Native SQL
- Filtering Collections - Working with Associations
- Final Thoughts - Keeping your Modules independent
- Find by Primary Key - Getting Started with Doctrine
- From, Join and Index by - Doctrine Query Language
- Functions - Doctrine Query Language
- Functions, Operators, Aggregates - Doctrine Query Language
- General Considerations - Composite and Foreign Keys as Primary Key
- General Getters - PHP Mapping
- General Setters - PHP Mapping
- Generating Proxy classes - Advanced Configuration
- Generating the Database Schema - Getting Started with Doctrine
- Generic count query for pagination - Extending DQL in Doctrine ORM: Custom AST Walkers
- Getting ClassMetadata Instances - Metadata Drivers
- Getting Help - Welcome to Doctrine ORM's documentation!
- Getting Started - Welcome to Doctrine ORM's documentation!
- Guide Assumptions - Getting Started with Doctrine
- Handling different Timezones with the DateTime Type - Working with DateTime Instances
- High level API methods - The QueryBuilder
- How Doctrine Detects Changes - Doctrine Internals explained
- How Doctrine keeps track of Objects - Doctrine Internals explained
- How can I add columns to a many-to-many table? - Frequently Asked Questions
- How can I add default values to a column? - Frequently Asked Questions
- How can I filter an association? - Frequently Asked Questions
- How can i paginate fetch-joined collections? - Frequently Asked Questions
- How do I set the charset and collation for MySQL tables? - Frequently Asked Questions
- Hydration - Doctrine Internals explained
- I call clear() on a One-To-Many collection but the entities are not deleted - Frequently Asked Questions
- Identifier Getters - PHP Mapping
- Identifier Quoting and Legacy Databases - Limitations and Known Issues
- Identifiers - Doctrine Query Language
- Identifiers / Primary Keys - Basic Mapping
- Identity through foreign Entities - Composite and Foreign Keys as Primary Key
- Ignoring entities (*OPTIONAL*) - Advanced Configuration
- Implementing Event Listeners - Events
- Implementing Metadata Drivers - Metadata Drivers
- Implementing a TypedFieldMapper - Implementing a TypedFieldMapper
- Implementing a naming strategy - Implementing a NamingStrategy
- Implementing more Requirements - Getting Started with Doctrine
- Implementing the listener - SQL-Table Prefixes
- Important concepts - Association Updates: Owning Side and Inverse Side
- Index - Attributes Reference
- Inheritance - Frequently Asked Questions
- Inheritance Getters - PHP Mapping
- Inheritance Setters - PHP Mapping
- Initialize collections in the constructor - Best Practices
- Initializing Collections - Association Mapping
- Initializing embeddables - Separating Concerns using Embeddables
- Input Parameter - Doctrine Query Language
- Is it better to write DQL or to generate it with the query builder? - Frequently Asked Questions
- Items - Doctrine Query Language
- Iterating Large Result Sets - Doctrine Query Language
- Iterating Large Results for Data-Processing - Batch Processing
- Iterating results - Batch Processing
- Join Column Element - XML Mapping
- Join-Columns with non-primary keys - Limitations and Known Issues
- Join-table management when removing from many-to-many collections - Working with Objects
- Joined entity results - Native SQL
- Joins - Doctrine Query Language
- Keeping Updates and Deletes in Sync - Aggregate Fields
- Known Issues - Limitations and Known Issues
- Lifecycle Callback Getters - PHP Mapping
- Lifecycle Callback Setters - PHP Mapping
- Lifecycle Callbacks - Events
- Lifecycle Callbacks Event Argument - Events
- Limitations - The Second Level Cache
- Limiting the Result - The QueryBuilder
- List of Bugs - Getting Started with Doctrine
- Listening and subscribing to Lifecycle Events - Events
- Literal Values - Doctrine Query Language
- Load ClassMetadata Event - Events
- Locking Support - Transactions and Concurrency
- Low Level API - The QueryBuilder
- Many-To-Many, Bidirectional - Association Mapping
- Many-To-Many, Self-referencing - Association Mapping
- Many-To-Many, Unidirectional - Association Mapping
- Many-To-One, Unidirectional - Association Mapping
- Mapped Superclasses - Architecture
- Mapped Superclasses - Inheritance Mapping
- Mapping - Frequently Asked Questions
- Mapping Arrays to a Join Table - Limitations and Known Issues
- Mapping Defaults - Association Mapping
- Mapping Indexed Associations - Working with Indexed Associations
- Mapping Objects onto a Database - Welcome to Doctrine ORM's documentation!
- Mapping many tables to one entity - Limitations and Known Issues
- Mapping multiple private fields of the same name - Limitations and Known Issues
- Meta results - Native SQL
- Metadata Cache (*RECOMMENDED*) - Advanced Configuration
- Metadata Cache - Caching
- Metadata Driver (*REQUIRED*) - Advanced Configuration
- Metadata and Query caches - Improving Performance
- Microsoft SQL Server and Doctrine "datetime" - Limitations and Known Issues
- Modify the Output Walker to generate Vendor specific SQL - Extending DQL in Doctrine ORM: Custom AST Walkers
- Multiple Metadata Sources - Advanced Configuration
- MySQL with MyISAM tables - Limitations and Known Issues
- Named and Positional Parameters - Doctrine Query Language
- Naming convention - Events
- Naming strategy interface - Implementing a NamingStrategy
- Nested Set - Limitations and Known Issues
- Number of Bugs - Getting Started with Doctrine
- Obtaining an EntityManager - Installation and Configuration
- Obtaining the EntityManager - Getting Started with Doctrine
- One-To-Many, Bidirectional - Association Mapping
- One-To-Many, Self-referencing - Association Mapping
- One-To-Many, Unidirectional with Join Table - Association Mapping
- One-To-One, Bidirectional - Association Mapping
- One-To-One, Self-referencing - Association Mapping
- One-To-One, Unidirectional - Association Mapping
- Optimistic Locking - Transactions and Concurrency
- Option 1 - Implementing ArrayAccess for Domain Objects
- Option 2 - Implementing ArrayAccess for Domain Objects
- Orphan Removal - Working with Associations
- Other Expressions - Doctrine Query Language
- Outlook into the Future - Working with Indexed Associations
- Overrides - Inheritance Mapping
- Owning and Inverse Side on a ManyToMany Association - Association Mapping
- PHP Types Mapping - Basic Mapping
- Paginator - The Second Level Cache
- Path Expressions - Doctrine Query Language
- Performance - Frequently Asked Questions
- Performance Considerations - Composite and Foreign Keys as Primary Key
- Performance impact - Inheritance Mapping
- Performance impact on to-one associations - Inheritance Mapping
- Performance of different deletion strategies - Working with Objects
- Persist Keys of Collections - Limitations and Known Issues
- Persistence by Reachability: Cascade Persist - Working with Associations
- Persistent fields - Architecture
- Persisters - Doctrine Internals explained
- Persisting entities - Working with Objects
- Pessimistic Locking - Transactions and Concurrency
- Preventing Mass Assignment Vulnerabilities - Security
- Primitive Types only - Composite and Foreign Keys as Primary Key
- Project Setup - Getting Started with Doctrine
- Property Mapping - Basic Mapping
- Proxy Directory (*REQUIRED*) - Advanced Configuration
- Proxy Namespace (*REQUIRED*) - Advanced Configuration
- Proxy Objects - Advanced Configuration
- Pure and Mixed Results - Doctrine Query Language
- Queries for Application Use-Cases - Getting Started with Doctrine
- Query Cache (*RECOMMENDED*) - Advanced Configuration
- Query Cache - Caching
- Query Internals - Doctrine Internals explained
- Query Language - Doctrine Query Language
- Query Result Formats (Hydration Modes) - Doctrine Query Language
- Query the Type - Inheritance Mapping
- Querying - Working with Objects
- Querying Inherited Classes - Doctrine Query Language
- Querying indexed associations - Working with Indexed Associations
- Quoting Reserved Words - Basic Mapping
- Re-use console application - Tools
- Read-Only Entities - Improving Performance
- Read-only - Implementing ArrayAccess for Domain Objects
- Reference - Attributes Reference
- Reference Proxies - Advanced Configuration
- Region Lifetime - The Second Level Cache
- Registering Event Handlers - Events
- Registering your own DQL functions - DQL User Defined Functions
- Removing Associations - Working with Associations
- Removing entities - Working with Objects
- Requirements - Architecture
- Result Cache - Caching
- Result format - Doctrine Query Language
- ResultSetMapping - Doctrine Internals explained
- ResultSetMappingBuilder - Native SQL
- Runtime reflection methods - PHP Mapping
- Runtime vs Development Mapping Validation - Tools
- SELECT queries - Doctrine Query Language
- SQL Logger (*Optional*) - Advanced Configuration
- SQL Schema considerations - Inheritance Mapping
- SQLWalker - Doctrine Internals explained
- Scalar and Type Expressions - Doctrine Query Language
- Scalar results - Native SQL
- Scenario / Problem - Strategy-Pattern
- SchemaTool Events - Events
- Select Expressions - Doctrine Query Language
- Serializing entities - Architecture
- Serializing entity into the session - Entities in the Session
- Set up - Keeping your Modules independent
- Setting Up the Console - Tools
- Setting up the Commandline Tool - Installation and Configuration
- Setting up the Console - Advanced Configuration
- Simplified XML Driver - XML Mapping
- Single Table - Doctrine Query Language
- Single Table Inheritance - Inheritance Mapping
- Solution - Strategy-Pattern
- Solution 1: Mapping to Varchars - Mysql Enums
- Solution 2: Defining a Type - Mysql Enums
- Starting with the Product Entity - Getting Started with Doctrine
- Statements - Doctrine Query Language
- Static Function - PHP Mapping
- Suspending/Restoring Filters - Filters
- Synchronization with the Database - Working with Objects
- Synchronizing Bidirectional Collections - Working with Associations
- Synchronizing New and Managed Entities - Working with Objects
- Synchronizing Removed Entities - Working with Objects
- Tackling Race Conditions with Aggregate Fields - Aggregate Fields
- Telling the EntityManager about our listener - SQL-Table Prefixes
- Temporarily change fetch mode in DQL - Improving Performance
- Terminals - Doctrine Query Language
- Terminology - Architecture
- The DBAL Package - Architecture
- The EntityManager - Architecture
- The Event System - Events
- The Expr class - The QueryBuilder
- The NativeQuery class - Native SQL
- The ORM Package - Architecture
- The Query class - Doctrine Query Language
- The ResultSetMapping - Native SQL
- The Unit of Work - Architecture
- The cost of flushing - Working with Objects
- The different ORM Layers - Doctrine Internals explained
- The entity - Advanced field value conversion using custom mapping types
- The mapping type - Advanced field value conversion using custom mapping types
- The size of a Unit of Work - Working with Objects
- Timestamp region - The Second Level Cache
- Transaction Demarcation - Transactions and Concurrency
- Transactional write-behind - Architecture
- Transient Classes - Architecture
- Transitive persistence / Cascade Operations - Working with Associations
- Tutorials - Welcome to Doctrine ORM's documentation!
- Typed functions - DQL User Defined Functions
- TypedFieldMapper interface - Implementing a TypedFieldMapper
- Types of Caches - Caching
- Types of DQL queries - Doctrine Query Language
- UPDATE queries - Doctrine Query Language
- Underscore naming strategy - Implementing a NamingStrategy
- UnitOfWork - Doctrine Internals explained
- Updating Entities - Getting Started with Doctrine
- Updating an entity - Entities in the Session
- Use cascades judiciously - Best Practices
- Use events judiciously - Best Practices
- Use explicit transaction demarcation - Best Practices
- Use-Case 1: Dynamic Attributes - Composite and Foreign Keys as Primary Key
- Use-Case 2: Simple Derived Identity - Composite and Foreign Keys as Primary Key
- Use-Case 3: Join-Table with Metadata - Composite and Foreign Keys as Primary Key
- User input and Doctrine ORM - Security
- Using DQL - Aggregate Fields
- Using INDEX BY - Doctrine Query Language
- Using Traits in Entity Classes - Limitations and Known Issues
- Using an Aggregate Field - Aggregate Fields
- Using an Object-Relational Mapper - Architecture
- Using the query cache - The Second Level Cache
- Using the repository query cache - The Second Level Cache
- Using your Domain Model - Aggregate Fields
- Versioning Setters - PHP Mapping
- What are Entities? - Getting Started with Doctrine
- What is DQL? - Frequently Asked Questions
- What is Doctrine? - Getting Started with Doctrine
- What is the problem? - Partial Objects
- What is wrong when I get an InvalidArgumentException "A new entity was found through the relationship.."? - Frequently Asked Questions
- When should I force partial objects? - Partial Objects
- Why do I get exceptions about unique constraint failures during $em->flush()? - Frequently Asked Questions
- Why does Doctrine not create proxy objects for my inheritance hierarchy? - Frequently Asked Questions
- Why does pagination not work correctly with fetch joins? - Frequently Asked Questions
- Why does the EntityGenerator not do X? - Frequently Asked Questions
- Why does the EntityGenerator not generate inheritance correctly? - Frequently Asked Questions
- Why is an extra SQL query executed every time I fetch an entity with a one-to-one relation? - Frequently Asked Questions
- Working with Objects - Welcome to Doctrine ORM's documentation!
- Working with QueryBuilder - The QueryBuilder
- Working with custom data transfer objects - Entities in the Session
- Working with scalars - Entities in the Session
- XML-Element Reference - XML Mapping
- onClear - Events
- onFlush - Events
- postFlush - Events
- postGenerateSchema - Events
- postGenerateSchemaTable - Events
- postLoad - Events
- postUpdate, postRemove, postPersist - Events
- preFlush - Events
- prePersist - Events
- preRemove - Events
- preUpdate - Events