From f1df26991f77dfc1417ac71ebb1f3a83b9be442d Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 30 Aug 2006 22:45:13 +0000 Subject: [PATCH] Code example for setting validators --- ...le definition - Constraints and validators.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manual/codes/Getting started - Setting table definition - Constraints and validators.php b/manual/codes/Getting started - Setting table definition - Constraints and validators.php index e69de29bb..d7da54366 100644 --- a/manual/codes/Getting started - Setting table definition - Constraints and validators.php +++ b/manual/codes/Getting started - Setting table definition - Constraints and validators.php @@ -0,0 +1,15 @@ +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"); + + } +} +?>