1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Getting started - Starting new project.php
2006-07-23 21:08:06 +00:00

11 lines
836 B
PHP

Doctrine_Record is the basic component of every doctrine-based project.
There should be atleast one Doctrine_Record for each of your database tables.
Doctrine_Record follows <a href="http://www.martinfowler.com/eaaCatalog/activeRecord.html">Active Record pattern</a>.
<br \><br \>
Doctrine auto-creates database tables and always adds a primary key column named 'id' to tables. 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.
<br \><br \>
Consider we want to create a database table called 'user' with columns id(primary key), name, username, password and created. You only need couple of lines of code
to create a simple CRUD (Create, Retrieve, Update, Delete) application for this database table.