Object relational mapping - Record identifiers - Autoincremented.php 397 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2
Autoincrement primary key is the most basic identifier and its usage is strongly encouraged. Sometimes you may want to use some other name than 'id'
for your autoinc primary key. It can be specified as follows:
3

hansbrix's avatar
hansbrix committed
4 5 6 7 8 9 10 11
<code type="php">
class User extends Doctrine_Record {
    public function setTableDefinition() {
        $this->hasColumn('uid','integer',20,'primary|autoincrement');

    }
}
</code>