Object relational mapping - Record identifiers - Natural.php 419 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2
Natural identifier is a property or combination of properties that is unique and non-null. The use of natural identifiers
is discouraged. You should consider using autoincremented or sequential primary keys as they make your system more scalable.
3

hansbrix's avatar
hansbrix committed
4 5 6 7 8 9 10
<code type="php">
class User extends Doctrine_Record {
    public function setTableDefinition() {
        $this->hasColumn('name','string',200,'primary');
    }
}
</code>