Getting started - Setting table definition - Introduction.php 476 Bytes
Newer Older
doctrine's avatar
doctrine committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
class Email extends Doctrine_Record {
    public function setTableDefinition() {
        // setting custom table name:
        $this->setTableName('emails');

        $this->hasColumn("address",         // name of the column
                         "string",          // column type
                         "200",             // column length
                         "notblank|email"   // validators / constraints
                         );
    }
}
?>