1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/docs/Getting started - Starting new project.php

11 lines
825 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
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 \>
2006-08-07 00:46:12 +04:00
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
2006-07-24 01:08:06 +04:00
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
2006-08-07 00:46:12 +04:00
to create a simple up-and-running model.
2006-07-24 01:08:06 +04:00