2006-04-13 20:37:28 +00:00
|
|
|
<?php
|
2006-04-16 08:41:45 +00:00
|
|
|
class Doctrine_Validator_Notblank {
|
2006-04-13 20:37:28 +00:00
|
|
|
/**
|
|
|
|
* @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-04-13 20:37:28 +00:00
|
|
|
$string = str_replace("\n","",$value);
|
|
|
|
$string = str_replace("\r","",$string);
|
|
|
|
$string = str_replace("\t","",$string);
|
|
|
|
$string = str_replace("\s","",$string);
|
|
|
|
$string = str_replace(" ","",$string);
|
2006-05-24 22:33:48 +00:00
|
|
|
if($string == "") return false;
|
|
|
|
|
|
|
|
return true;
|
2006-04-13 20:37:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|