2006-04-13 20:37:28 +00:00
|
|
|
<?php
|
|
|
|
class Doctrine_Validator_Regexp {
|
|
|
|
/**
|
|
|
|
* @param Doctrine_Record $record
|
|
|
|
* @param string $key
|
|
|
|
* @param mixed $value
|
2006-05-24 22:33:48 +00:00
|
|
|
* @param string $args
|
2006-04-13 20:37:28 +00:00
|
|
|
* @return boolean
|
|
|
|
*/
|
2006-05-24 22:33:48 +00:00
|
|
|
public function validate(Doctrine_Record $record, $key, $value, $args) {
|
2006-05-26 11:32:35 +00:00
|
|
|
if(preg_match("/$args/", $value))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
2006-04-13 20:37:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|