1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/manual/codes/Getting started - Setting table definition - Constraints and validators.php
2006-08-30 22:45:13 +00:00

16 lines
469 B
PHP

<?php
class User extends Doctrine_Record {
public function setTableDefinition() {
// the name cannot contain whitespace
$this->hasColumn("name", "string", 50, "nospace");
// the email should be a valid email
$this->hasColumn("email", "string", 200, "email");
// home_country should be a valid country code
$this->hasColumn("home_country", "string", 2, "country");
}
}
?>