Code example for setting validators
This commit is contained in:
parent
3b8b1a4e88
commit
f1df26991f
@ -0,0 +1,15 @@
|
||||
<?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");
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user