From cfa0351d2b44b956b679c5cf6f069118ef1dbf24 Mon Sep 17 00:00:00 2001 From: pookey Date: Thu, 31 May 2007 18:09:03 +0000 Subject: [PATCH] adding an example contianing a list and a code block --- manual/docbook/doctrine.xml | 94 +++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/manual/docbook/doctrine.xml b/manual/docbook/doctrine.xml index 6e72e0192..0a72cb0b2 100644 --- a/manual/docbook/doctrine.xml +++ b/manual/docbook/doctrine.xml @@ -9,15 +9,15 @@ Doctrine Documentation + + Konsta + Vesterinen + Ian Christian pookey@pookey.co.uk - - Konsta - Vesterinen - Doctrine Project 2007 @@ -31,27 +31,30 @@ - Documentation for the PHP Doctrine project + Documentation for the PHP Doctrine project. + + + This document was generated . Introduction - - Doctrine is a Object Relational Mapping and database abstraction - framework for PHP. The DBAL part of Doctrine derives from MDB2. The key - idea was to provide very intuitive and easy-to-use persistency solution - (eg. RoR ActiveRecord) with all the advanced features from the more - heavy-weight solutions (eg. Hibernate). - - - Doctrine Query Language implements EJB 3 OQL specificiation and expands - it a bit further (it has special LIMIT and OFFSET clauses). - - - - + + About Doctrine + + Doctrine is a Object Relational Mapping and database abstraction + framework for PHP. The DBAL part of Doctrine derives from MDB2. The key + idea was to provide very intuitive and easy-to-use persistency solution + (eg. RoR ActiveRecord) with all the advanced features from the more + heavy-weight solutions (eg. Hibernate). + + + Doctrine Query Language implements EJB 3 OQL specificiation and expands + it a bit further (it has special LIMIT and OFFSET clauses). + + Requirements @@ -144,6 +147,59 @@ DQL (Doctrine Query Lanaguage) + + Introduction + + Doctrine Query Language(DQL) is an Object Query Language created for helping users in complex object retrieval. + + + You should always consider using DQL(or raw SQL) when retrieving relational data efficiently (eg. when fetching users and their phonenumbers). + + + When compared to using raw SQL, DQL has several benefits: + + + + From the start it has been designed to retrieve records(objects) not result set rows. + DQL understands relations so you don't have to type manually sql joins and join conditions. + DQL is portable on different databases + DQL has some very complex built-in algorithms like (the record limit algorithm) which can help developer to efficiently retrieve objects. + It supports some functions that can save time when dealing with one-to-many, many-to-many relational data with conditional fetching. + + + + If the power of DQL isn't enough, you should consider using the rawSql API for object population. + + + getTable('User')->findAll(); + foreach($users as $user) { + print $user->name."\n"; + foreach($user->Phonenumber as $phonenumber) { + print $phonenumber."\n"; + } + } + + // same thing implemented much more efficiently: + // (using only one sql query for object population) + + $users = $conn->query("FROM User.Phonenumber"); + foreach($users as $user) { + print $user->name."\n"; + foreach($user->Phonenumber as $phonenumber) { + print $phonenumber."\n"; + } + } + + ?> + ]]> + + +