2006-08-31 02:45:13 +04:00
|
|
|
<?php
|
|
|
|
class User extends Doctrine_Record {
|
|
|
|
public function setTableDefinition() {
|
|
|
|
// the name cannot contain whitespace
|
2006-09-05 00:01:02 +04:00
|
|
|
$this->hasColumn("name", "string", 50, array("nospace" => true));
|
|
|
|
|
2006-08-31 02:45:13 +04:00
|
|
|
// the email should be a valid email
|
2006-09-05 00:01:02 +04:00
|
|
|
$this->hasColumn("email", "string", 200, array("email" => true));
|
|
|
|
|
|
|
|
// home_country should be a valid country code and not null
|
|
|
|
$this->hasColumn("home_country", "string", 2, array("country" => true, "notnull" => true));
|
|
|
|
|
2006-08-31 02:45:13 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|