Frequently Asked Questions
Doctrine FAQ
- Can I build my models in something other than PHP?
- Can I generate my Doctrine schema/models from an existing database?
- Can I use Doctrine with a MVC Framework?
- Can I use Raw/Native SQL with Doctrine?
- Does Doctrine support inheritance?
- Does Doctrine support many2many relationships?
- How can I update a record without retrieving it first?
- How can I upgrade my database when my schema changes?
- How do I lazy load my model classes?
- How do I submit a bug?
- How do I use Doctrine with the symfony MVC framework?
- How do I use Doctrine with the Zend Framework?
- How stable and mature is Doctrine??
- What is the best way to get started with Doctrine?
- Why does DQL not recognize my DB functions?
-
Can I build my models in something other than PHP?
Yes. Doctrine offers the ability to optionally specify your schema as a set of YAML files. You can read about schema files here.
-
Can I generate my Doctrine schema/models from an existing database?
Yes. Doctrine offers a database import feature which will generate your php models or yaml schema files from an existing database.
-
Can I use Doctrine with a MVC Framework?
Yes. Doctrine has already been successfully integrated with several well known PHP frameworks. You can check the list with links to tutorials here.
-
Can I use Raw/Native SQL with Doctrine?
Yes. Doctrine offers the ability for you to write raw SQL statements and manually map the data for hydration. You can read more about Native SQL here.
-
Does Doctrine support inheritance?
Yes. Currently Doctrine supports three types of inheritance and they are: Simple, Concrete and Column Aggregation inheritance. You can read more about inheritance here.
-
Does Doctrine support many2many relationships?
Yes. Doctrine fully supports many2many relationships, as well as self referencing ones.
-
How can I update a record without retrieving it first?
Doctrine offers the ability to specify update statements with DQL. You can read about it here.
-
How can I upgrade my database when my schema changes?
Doctrine offers this functionality via the migrations feature. It allows you to programatically write upgrade classes which alter an existing database schema. Doctrine also offers features which will automatically generate these upgrade classes for you.
-
How do I lazy load my model classes?
Doctrine offers a method for lazy loading models called conservative model loading. You can read about what it is and how you can take advantage of it here. Doctrine also offers aggressive model loading but is not recommended for production environments.
-
How do I submit a bug?
You can submit a bug via our trac system. It is required that you register to submit a bug. It also is recommended that you write a failing test case for your issue, you can read about test cases here.
-
How do I use Doctrine with the symfony MVC framework?
You can read about how to integrate Doctrine with frameworks like the symfony here. Doctrine has been successfully integrated with several well known PHP frameworks.
-
How do I use Doctrine with the Zend Framework?
You can read about how to integrate Doctrine with frameworks like the Zend Framework here. Doctrine has been successfully integrated with several well known PHP frameworks.
-
How stable and mature is Doctrine??
Doctrine has been under development since April 4th, 2006 and has evoled over a dozen development iterations since then. Doctrine has not yet reached 1.0, but the code base is very stable and is scheduled to reach 1.0 during the 2nd quarter of 2008. Doctrine is successfully used in many production projects by individuals and companies. It is also tightly integrated with many successfull MVC frameworks such as code igniter and symfony.
-
What is the best way to get started with Doctrine?
The best way to get started is to read the Getting Started chapter and follow the My First Project tutorial at the end of the chapter.
-
Why does DQL not recognize my DB functions?
Doctrine by default runs with portability on. In order for you to execute dbms specific functions you must turn portability off. You can read about portability here.