This commit is contained in:
parent
067fe93cef
commit
5d67e0aaed
6
classes/Null.class.php
Normal file
6
classes/Null.class.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Doctrine_Null
|
||||||
|
*/
|
||||||
|
class Doctrine_Null { }
|
||||||
|
?>
|
23
classes/Validator/Enum.class.php
Normal file
23
classes/Validator/Enum.class.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
class Doctrine_Validator_Enum {
|
||||||
|
/**
|
||||||
|
* @param Doctrine_Record $record
|
||||||
|
* @param string $key
|
||||||
|
* @param mixed $value
|
||||||
|
* @param string $args
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function validate(Doctrine_Record $record, $key, $value, $args) {
|
||||||
|
$max = substr_count($args, "-");
|
||||||
|
$int = (int) $value;
|
||||||
|
|
||||||
|
if($int != $value)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if($int < 0 || $int > $max)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
x
Reference in New Issue
Block a user