. */ require_once 'propel/validator/BasicValidator.php'; /** * A validator for maximum string length. * * Below is an example usage for your Propel xml schema file. * * Note that if you have specified the size attribute in the column tag * you do not have to specify it as value in the validator rule again as * this is done automatically. * * * * * * * * * * @author Michael Aichler * @version $Revision: 536 $ * @package propel.validator */ class MaxLengthValidator implements BasicValidator { public function isValid (ValidatorMap $map, $str) { return strlen($str) <= intval($map->getValue()); } }