diff --git a/manual/docbook/doctrine.xml b/manual/docbook/doctrine.xml index b3d4df3e3..249c778bc 100644 --- a/manual/docbook/doctrine.xml +++ b/manual/docbook/doctrine.xml @@ -206,6 +206,44 @@ url="http://www.martinfowler.com/eaaCatalog/activeRecord.html">Active Record pattern + + 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 + defining a class which extends Doctrine_Record and setting a + setTableDefinition method with hasColumn() method calls. + + + An short example: + + + We want to create a database table called 'user' with columns + id(primary key), name, username, password and created. Provided that + you have already installed Doctrine these few lines of code are all you + need: + + hasColumn('name','string',30); + $this->hasColumn('username','string',20); + $this->hasColumn('password','string',16); + $this->hasColumn('created','integer',11); + } + } +?>]]> + + We now have a user model that supports basic CRUD opperations! +