. */ /** * Doctrine_Validator_Date * * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen */ class Doctrine_Validator_Date { /** * checks if given value is a valid date * * @param mixed $value * @return boolean */ public function validate($value) { if ($value === null) { return true; } $e = explode('-', $value); if (count($e) !== 3) { return false; } return checkdate($e[1], $e[2], $e[0]); } }