diff --git a/manual/docbook/README b/manual/docbook/README index 07fe184cc..2f870ac1f 100644 --- a/manual/docbook/README +++ b/manual/docbook/README @@ -1,5 +1,4 @@ -PLEASE DO NOT USE ------------------ +WORK IN PROGRESS!!! Please feel free to contribute, but these docs are currently being developed by Ian P. Christian . @@ -18,6 +17,8 @@ http://www.sagehill.net/docbookxsl/index.html For information about docbook itself, google - there's LOTS of sites. This is a good reference: http://xml.web.cern.ch/XML/goossens/dbatcern/index.html +the 'definitive guide' can be found here: +http://www.docbook.org/tdg/en/html/docbook.html Xsieve is used for syntax highlighting: diff --git a/manual/docbook/doctrine.xml b/manual/docbook/doctrine.xml index 249c778bc..4130b4f24 100644 --- a/manual/docbook/doctrine.xml +++ b/manual/docbook/doctrine.xml @@ -12,11 +12,14 @@ Konsta Vesterinen + The creator and lead developer. Ian + P. Christian pookey@pookey.co.uk + Junior developer and documentation maintainer. Doctrine Project @@ -46,7 +49,7 @@ 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 + idea is 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). @@ -54,6 +57,58 @@ Doctrine Query Language implements EJB 3 OQL specificiation and expands it a bit further (it has special LIMIT and OFFSET clauses). + + Example + + You might not understand exactly what's happening at this stage, but + this example is to give you a general idea of the power of Doctrine. + + + hasColumn('name','string',30); + $this->hasColumn('username','string',20); + $this->hasColumn('password','string',16); + $this->hasColumn('created','integer',11); + } + } + + // create a new user + $user = new User(); + $user->username = "Pookey"; + $user->password = "a password!"; + $user->created = time(); + + // save the user + $user->save(); + + // lets find the user.... + $query = new Doctrine_Query(); + $query->query('SELECT u.* FROM User u WHERE u.username = ?'); + $users = $query->execute(array('pookey')); + if (count($users)) + { + // we found our user! + } + else + { + // we didn't find our user, oh no! + } +?>]]> + @@ -101,10 +156,17 @@ The #doctrine IRC channel can be found on the freenode network. + + Wiki and Trac + + A wiki/trac install can be found at http://doctrine.pengus.net/trac + + - Contributing + Contributing/Reporting Bugs Doctrine is constantly under development, and is always happy for new developers to contribute to the project. @@ -114,6 +176,11 @@ access to commit to the SVN repository, please visit the IRC channel, or email the users mailing list. + + If you are unsure as to wether you have found a bug or not, please + consider joining us on IRC, or maining the user mailing list to confirm + your problem. + @@ -124,12 +191,15 @@ SVN. - To get the latest copy, simple check out 'trunk' from SVN. You will need subversion - install to check out doctrine. If you are unable to install subversion for whatever - reason, see below for details on downloading a snapshot. + To get the latest copy, simple check out 'trunk' from SVN. You will + need subversion + install to check out doctrine. If you are unable to install subversion + for whatever reason, see below for details on downloading a snapshot. - bash $svn checkout http://doctrine.pengus.net/svn/trunk + bash $mkdir doctrine + bash $cd doctrine + bash $svn checkout http://doctrine.pengus.net/svn/trunk . Daily snapshots can be found at @@ -185,8 +255,11 @@ Compiling is a method for making a single file of most used doctrine runtime components including the compiled file instead of multiple files (in worst cases dozens of files) can improve performance by an order of - magnitude. In cases where this might fail, a Doctrine_Exception is throw - detailing the error. + magnitude. + + + In cases where this might fail, a Doctrine_Exception is throw detailing + the error. Doctrine auto-creates database tables and always adds a primary key column named 'id' to tables that doesn't have any primary keys - specified. Only thing you need to for creating database tables is + specified. The only thing you need to do to create database tables is defining a class which extends Doctrine_Record and setting a setTableDefinition method with hasColumn() method calls. - An short example: + Below is a short example: We want to create a database table called 'user' with columns