Commit f1df2699 authored by zYne's avatar zYne

Code example for setting validators

parent 3b8b1a4e
<?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");
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment