summaryrefslogtreecommitdiff
path: root/classes/Avatar.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-20 14:57:56 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-20 14:57:56 -0400
commit5d1a6f0fef3b99167babfa304ceda9b67720f399 (patch)
tree451830a55e2cacac2d224ac85a6e2d74a57a36ac /classes/Avatar.php
parenta9c57467e77f5420cca866d5e4c28b10da2f75fc (diff)
add validation methods to classes
darcs-hash:20080520185756-84dde-290bc12cddfc1738a96385e95821d466eff11196.gz
Diffstat (limited to 'classes/Avatar.php')
-rw-r--r--classes/Avatar.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 2e0e1f3fb..57e0d2fa8 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -25,4 +25,16 @@ class Avatar extends DB_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ function validateMediatype() {
+ return Validate::string($this->mediatype, array('min_length' => 1, 'max_length' => 32));
+ }
+
+ function validateFilename() {
+ return Validate::string($this->filename, array('min_length' => 1, 'max_length' => 255));
+ }
+
+ function validateUrl() {
+ return Validate::uri($this->url, array('allowed_schemes' => array('http', 'https')));
+ }
}