1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests_old/models/ValidatorTest.php
2008-02-23 22:04:39 +00:00

25 lines
969 B
PHP

<?php
class ValidatorTest extends Doctrine_Record {
public static function initMetadata($class) {
$class->setColumn('mymixed', 'string', 100);
$class->setColumn('mystring', 'string', 100,
array('validators' => array('notnull', 'unique'))
);
$class->setColumn('myarray', 'array', 1000);
$class->setColumn('myobject', 'object', 1000);
$class->setColumn('myinteger', 'integer', 11);
$class->setColumn('myrange', 'integer', 11,
array('validators' => array('range' => array(4,123)))
);
$class->setColumn('myregexp', 'string', 5,
array('validators' => array('regexp' => '/^[0-9]+$/'))
);
$class->setColumn('myemail', 'string', 100,
array('validators' => array('email'))
);
$class->setColumn('myemail2', 'string', 100,
array('validators' => array('email', 'notblank'))
);
}
}