Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Validator\Constraints; Chris@0: Chris@0: use Symfony\Component\Validator\Constraint; Chris@0: Chris@0: /** Chris@0: * @Annotation Chris@0: * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) Chris@0: * Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: class DateTime extends Constraint Chris@0: { Chris@0: const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; Chris@0: const INVALID_DATE_ERROR = 'd52afa47-620d-4d99-9f08-f4d85b36e33c'; Chris@0: const INVALID_TIME_ERROR = '5e797c9d-74f7-4098-baa3-94390c447b27'; Chris@0: Chris@17: protected static $errorNames = [ Chris@0: self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', Chris@0: self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR', Chris@0: self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', Chris@17: ]; Chris@0: Chris@0: public $format = 'Y-m-d H:i:s'; Chris@0: public $message = 'This value is not a valid datetime.'; Chris@0: }